untitled paste

unlisted ⁨1⁩ ⁨file⁩ 2021-06-08 20:40:10 UTC

zig.yml

Raw
name: zig

on:
  push:
    branches: [dev]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: checkout repository
        uses: actions/checkout@v2.3.4
      - 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/setup-zig@v1.3.0
        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