From 5a7c40e3f174f168aab25fd4fc4cd3866066d8a4 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sun, 26 Jun 2022 10:05:20 -0700 Subject: [PATCH] Build in CI --- .github/workflows/test.yml | 41 ++++++++++++++++++++++++++++++++++++++ flake.lock | 6 +++--- 2 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 000000000..14d419814 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,41 @@ +on: [push, pull_request] +name: Test +jobs: + build: + strategy: + matrix: + os: [ubuntu-latest] + + target: [ + aarch64-macos, + x86_64-macos, + + aarch64-linux-gnu, + aarch64-linux-musl, + i386-linux-gnu, + i386-linux-musl, + x86_64-linux-gnu, + x86_64-linux-musl, + + # No windows support currently. + # i386-windows, + # x86_64-windows-gnu, + ] + runs-on: ${{ matrix.os }} + needs: test + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + submodules: recursive + fetch-depth: 0 + + # Install Nix and use that to run our tests so our environment matches exactly. + - uses: cachix/install-nix-action@v17 + with: + nix_path: nixpkgs=channel:nixos-unstable + + # Run our go tests within the context of the dev shell from the flake. This + # will ensure we have all our dependencies. + - name: test + run: nix develop -c zig build -Dtarget=${{ matrix.target }} diff --git a/flake.lock b/flake.lock index cf2a9ac9d..3540ca23b 100644 --- a/flake.lock +++ b/flake.lock @@ -18,11 +18,11 @@ }, "flake-utils": { "locked": { - "lastModified": 1653893745, - "narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=", + "lastModified": 1656065134, + "narHash": "sha256-oc6E6ByIw3oJaIyc67maaFcnjYOz1mMcOtHxbEf9NwQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1", + "rev": "bee6a7250dd1b01844a2de7e02e4df7d8a0a206c", "type": "github" }, "original": {