From 01ea0a26c10614ee28955c063dac57993c71eb41 Mon Sep 17 00:00:00 2001 From: Akshay Date: Sat, 15 Jan 2022 10:31:10 +0530 Subject: init build & test flow --- .github/workflows/build.yml | 65 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..e720a52 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,65 @@ +name: build +on: + pull_request: + push: +jobs: + build: + strategy: + matrix: + os: + - ubuntu-latest + - macos-11 + nix: + - name: 2.5.1 + url: https://releases.nixos.org/nix/nix-2.5.1/install + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v2.3.5 + - uses: cachix/install-nix-action@v15 + with: + install_url: ${{ matrix.nix.url }} + extra_nix_config: | + experimental-features = nix-command flakes + + - name: enable binary cache + uses: cachix/cachix-action@v10 + with: + name: statix + authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' + + - run: nix flake check + + - name: build statix + run: nix build -L + + - name: build and install statix with flake-compat + run: nix-env -if default.nix + + tests: + strategy: + matrix: + os: + - ubuntu-latest + nix: + - name: 2.5.1 + url: https://releases.nixos.org/nix/nix-2.5.1/install + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v2.3.5 + + - uses: cachix/install-nix-action@v15 + with: + install_url: ${{ matrix.nix.url }} + extra_nix_config: | + experimental-features = nix-command flakes + + - uses: cachix/cachix-action@v10 + with: + name: statix + authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' + + - name: set up pinned nixpkgs + run: echo "NIX_PATH=nixpkgs=$(nix-instantiate --eval flake-compat.nix -A defaultNix.inputs.nixpkgs.outPath | sed 's|\"||g')" >> $GITHUB_ENV + + - run: nix-shell --run "cargo test" + -- cgit v1.2.3 From 47eae1978796a2138f799296f61149f1825dc24c Mon Sep 17 00:00:00 2001 From: Akshay Date: Sat, 15 Jan 2022 10:35:25 +0530 Subject: disable macos for now --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e720a52..cf64f20 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,7 +8,6 @@ jobs: matrix: os: - ubuntu-latest - - macos-11 nix: - name: 2.5.1 url: https://releases.nixos.org/nix/nix-2.5.1/install -- cgit v1.2.3 From 33e2442049442f52fc07b34c3c6bd0ec8fb636d8 Mon Sep 17 00:00:00 2001 From: Akshay Date: Sat, 15 Jan 2022 10:41:00 +0530 Subject: remove test matrix `nix build` already performs `cargo test` --- .github/workflows/build.yml | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cf64f20..c141655 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,37 +28,9 @@ jobs: - run: nix flake check + # this also includes `cargo test` - name: build statix run: nix build -L - name: build and install statix with flake-compat run: nix-env -if default.nix - - tests: - strategy: - matrix: - os: - - ubuntu-latest - nix: - - name: 2.5.1 - url: https://releases.nixos.org/nix/nix-2.5.1/install - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v2.3.5 - - - uses: cachix/install-nix-action@v15 - with: - install_url: ${{ matrix.nix.url }} - extra_nix_config: | - experimental-features = nix-command flakes - - - uses: cachix/cachix-action@v10 - with: - name: statix - authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' - - - name: set up pinned nixpkgs - run: echo "NIX_PATH=nixpkgs=$(nix-instantiate --eval flake-compat.nix -A defaultNix.inputs.nixpkgs.outPath | sed 's|\"||g')" >> $GITHUB_ENV - - - run: nix-shell --run "cargo test" - -- cgit v1.2.3