zig.yml
@@ -0,0 +1,64 @@
+name: zig
+
+on:
+ push:
+ branches: [dev]
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ steps:
+ - name: checkout repository
+ uses: actions/[email protected]
+ - name: install dependencies
+ run: |
+ sudo apt install -y build-essential libzstd-dev zstd gzip tar curl
+ curl -sL https://github.com/nektro/zigmod/releases/download/v36/zigmod-x86_64-linux -o zigmod
+ chmod +x zigmod
+ ./zigmod fetch
+ rm zigmod
+ - name: setup zig nightly build
+ uses: goto-bus-stop/[email protected]
+ with:
+ version: master
+ - name: build example binaries
+ run: zig build -Drelease-safe
+ - name: upload example binaries
+ uses: actions/upload-artifact@v2
+ with:
+ name: example_binaries
+ path: zig-out/bin
+ test:
+ runs-on: ubuntu-latest
+ needs: [build]
+ steps:
+ - name: download example binaries
+ uses: actions/download-artifact@v2
+ with:
+ name: example_binaries
+ path: binaries
+ - name: install dependencies
+ run: sudo apt install -y build-essential libzstd-dev zstd gzip tar curl
+ - name: prepare test data files
+ run: |
+ mkdir test
+ curl -sL https://github.com/facebook/zstd/releases/download/v1.1.3/github_users_sample_set.tar.gz | tar xz
+ curl http://api.seazon.org/1-1-1-1-1-0/0-0-1/2-9-45-85-3-4/api.txt -o test/lipsum.txt
+ zstd --train github/* -o test/github.dict
+ rm -rf github
+ - name: run compressor example
+ run: |
+ chmod +x binaries/compressor_example
+ ./binaries/compressor_example
+ - name: run stream example
+ run: |
+ chmod +x binaries/stream_example
+ ./binaries/stream_example
+ - name: run file exmample
+ run: |
+ chmod +x binaries/file_example
+ ./binaries/file_example
+ - name: run dictionary example
+ run: |
+ chmod +x binaries/dictionary_example
+ ./binaries/dictionary_example
\ No newline at end of file