From ed40bba5e6a9d503fe65eb43ba1f05e1bea25c60 Mon Sep 17 00:00:00 2001 From: Kevin Amado Date: Mon, 7 Feb 2022 23:22:53 -0500 Subject: [PATCH] feat: release workflow --- .github/workflows/pr.yaml | 43 ++++++++++++++++++++++++---------- .github/workflows/release.yaml | 34 +++++++++++++++++++++++++++ 2 files changed, 64 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 6936314..18e4d99 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -15,6 +15,10 @@ jobs: - name: Clone uses: actions/checkout@v2 + - uses: cachix/cachix-action@v10 + with: + name: alejandra + - name: Build uses: docker://nixos/nix with: @@ -26,20 +30,33 @@ jobs: build --print-build-logs - - name: Test + - name: Check uses: docker://nixos/nix with: args: > - bash -ec " - source <( \ - nix \ - --extra-experimental-features flakes \ - --extra-experimental-features nix-command \ - --extra-substituters http://172.17.0.1:5000?trusted=1 \ - print-dev-env \ - --no-update-lock-file \ - --no-write-lock-file \ - ) + nix + --extra-experimental-features flakes + --extra-experimental-features nix-command + --extra-substituters http://172.17.0.1:5000?trusted=1 + flake + check + --print-build-logs - cargo tarpaulin - " + # ERROR cargo_tarpaulin: Failed to run tests: ASLR disable failed: EPERM: Operation not permitted + # - name: Test + # uses: docker://nixos/nix + # with: + # args: > + # bash -ec " + # source <( \ + # nix \ + # --extra-experimental-features flakes \ + # --extra-experimental-features nix-command \ + # --extra-substituters http://172.17.0.1:5000?trusted=1 \ + # print-dev-env \ + # --no-update-lock-file \ + # --no-write-lock-file \ + # ) + + # cargo tarpaulin + # " diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..2b11889 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,34 @@ +name: Release +on: + push: + branches: [ main ] +concurrency: + cancel-in-progress: true + group: ${{ github.actor }} +jobs: + release: + name: Release + runs-on: self-hosted + steps: + - name: Clone + uses: actions/checkout@v2 + + - uses: cachix/cachix-action@v10 + with: + name: alejandra + authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} + + - name: Build + uses: docker://nixos/nix + with: + args: > + nix + --extra-experimental-features flakes + --extra-experimental-features nix-command + --extra-substituters http://172.17.0.1:5000?trusted=1 + build + --print-build-logs + + - name: Push + run: | + cachix push result