ci(mergify): upgrade configuration to current format #815
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test and publish | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
jobs: | |
test: | |
strategy: | |
matrix: | |
os: | |
- ubuntu-latest | |
- macos-latest | |
fail-fast: false | |
runs-on: ${{ matrix.os }} | |
env: | |
SSH_KEY_FOR_NIXBUILD: ${{ secrets.SSH_KEY_FOR_NIXBUILD }} | |
steps: | |
- uses: actions/checkout@v3 | |
- if: matrix.os == 'macos-latest' | |
uses: cachix/install-nix-action@v22 | |
- if: matrix.os == 'ubuntu-latest' | |
uses: nixbuild/nix-quick-install-action@v22 | |
with: | |
nix_conf: | | |
experimental-features = nix-command | |
extra-substituters = ssh://eu.nixbuild.net | |
extra-trusted-public-keys = nixbuild.net/dfinity-1:olw50jGlHUpa9UiCoyfLQz9aLR8vw4j7/KNuUsaaf/s= | |
- if: matrix.os == 'ubuntu-latest' && env.SSH_KEY_FOR_NIXBUILD != '' | |
uses: nixbuild/nixbuild-action@v16 | |
with: | |
nixbuild_ssh_key: ${{ secrets.SSH_KEY_FOR_NIXBUILD }} | |
- uses: cachix/cachix-action@v12 | |
with: | |
name: ic-hs-test | |
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' | |
# until https://github.com/cachix/cachix-action/issues/86 is fixed: | |
- run: cachix watch-store ic-hs-test & | |
# run a few targets explicitly, to get easier signal in the CI view | |
- if: matrix.os == 'ubuntu-latest' | |
run: nix build -f default.nix --eval-store auto --store ssh-ng://eu.nixbuild.net --builders "" --max-jobs 2 --no-link --print-build-logs universal-canister | |
- if: matrix.os == 'macos-latest' | |
run: nix-build -A universal-canister | |
- if: matrix.os == 'ubuntu-latest' | |
run: nix build -f default.nix --eval-store auto --store ssh-ng://eu.nixbuild.net --builders "" --max-jobs 2 --no-link --print-build-logs ic-hs | |
- if: matrix.os == 'macos-latest' | |
run: nix-build -A ic-hs | |
- if: matrix.os == 'ubuntu-latest' | |
run: cp -r "$(nix-build -A ic-hs.doc)"/share/doc/*/html gh-page | |
- if: matrix.os == 'ubuntu-latest' | |
run: nix build -f default.nix --eval-store auto --store ssh-ng://eu.nixbuild.net --builders "" --max-jobs 2 --no-link --print-build-logs ic-hs-coverage | |
- if: matrix.os == 'ubuntu-latest' | |
run: nix build -f default.nix --eval-store auto --store ssh-ng://eu.nixbuild.net --builders "" --max-jobs 2 --no-link --print-build-logs coverage | |
- if: matrix.os == 'ubuntu-latest' | |
run: nix build -f default.nix --eval-store auto --store ssh-ng://eu.nixbuild.net --builders "" --max-jobs 2 --no-link --print-build-logs check-generated | |
- if: matrix.os == 'macos-latest' | |
run: nix-build -A check-generated | |
- if: matrix.os == 'ubuntu-latest' | |
run: nix build -f default.nix --eval-store auto --store ssh-ng://eu.nixbuild.net --builders "" --max-jobs 2 --no-link --print-build-logs ic-ref-dist | |
- if: matrix.os == 'macos-latest' | |
run: nix-build -A ic-ref-dist | |
- if: matrix.os == 'ubuntu-latest' | |
run: nix build -f default.nix --eval-store auto --store ssh-ng://eu.nixbuild.net --builders "" --max-jobs 2 --no-link --print-build-logs ic-ref-test | |
- if: matrix.os == 'ubuntu-latest' | |
run: nix build -f default.nix --eval-store auto --store ssh-ng://eu.nixbuild.net --builders "" --max-jobs 2 --no-link --print-build-logs ic-hs-shell | |
- if: matrix.os == 'macos-latest' | |
run: nix-build -A ic-hs-shell | |
- if: matrix.os == 'ubuntu-latest' | |
run: nix build -f default.nix --eval-store auto --store ssh-ng://eu.nixbuild.net --builders "" --max-jobs 2 --no-link --print-build-logs license-check | |
- if: matrix.os == 'macos-latest' | |
run: nix-build -A license-check | |
release: | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} | |
needs: test | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-latest | |
nix-system: x86_64-linux | |
- os: macos-latest | |
nix-system: x86_64-darwin | |
runs-on: ${{ matrix.os }} | |
env: | |
SSH_KEY_FOR_NIXBUILD: ${{ secrets.SSH_KEY_FOR_NIXBUILD }} | |
steps: | |
- uses: actions/checkout@v3 | |
- if: matrix.os == 'macos-latest' | |
uses: cachix/install-nix-action@v22 | |
- if: matrix.os == 'ubuntu-latest' | |
uses: nixbuild/nix-quick-install-action@v22 | |
with: | |
nix_conf: experimental-features = nix-command | |
- if: matrix.os == 'ubuntu-latest' && env.SSH_KEY_FOR_NIXBUILD != '' | |
uses: nixbuild/nixbuild-action@v16 | |
with: | |
nixbuild_ssh_key: ${{ secrets.SSH_KEY_FOR_NIXBUILD }} | |
- uses: cachix/cachix-action@v12 | |
with: | |
name: ic-hs-test | |
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' | |
- run: nix-env -f 'channel:nixos-22.11' -iA awscli | |
- id: get_version | |
run: | | |
ver="$(grep '^version' ic-hs.cabal | tr -s ' ' | cut -d' ' -f2)" | |
echo "::set-output name=version::$ver" | |
- id: buildit | |
run: | | |
out_path="$(nix-build -A ic-ref-dist)" | |
echo "::set-output name=out::$out_path" | |
- run: | | |
if [[ -d "${{ steps.buildit.outputs.out }}/build/libs" ]] | |
then | |
tar -C "${{ steps.buildit.outputs.out }}/build" -czvf ic-ref.tar.gz ic-ref libs | |
tar -C "${{ steps.buildit.outputs.out }}" -czvf ic-ref-test.tar.gz build/ic-ref-test build/libs test-data | |
else | |
tar -C "${{ steps.buildit.outputs.out }}/build" -czvf ic-ref.tar.gz ic-ref | |
tar -C "${{ steps.buildit.outputs.out }}" -czvf ic-ref-test.tar.gz build/ic-ref-test test-data | |
fi | |
ref_short="$(echo "$GITHUB_SHA" | cut -c1-8)" | |
version="${{ steps.get_version.outputs.version }}-$ref_short" | |
aws s3 cp ic-ref.tar.gz "s3://dfinity-download/ic-ref/ic-ref-$version-$SYSTEM.tar.gz" | |
aws s3 cp ic-ref-test.tar.gz "s3://dfinity-download/ic-ref/ic-ref-test-$version-$SYSTEM.tar.gz" | |
env: | |
SYSTEM: ${{ matrix.nix-system }} | |
AWS_ACCESS_KEY_ID: '${{ secrets.AWS_ACCESS_KEY }}' | |
AWS_SECRET_ACCESS_KEY: '${{ secrets.AWS_SECRET_KEY }}' | |
- if: matrix.os == 'ubuntu-latest' | |
run: cp -r "$(nix-build -A ic-hs.doc)"/share/doc/*/html gh-page | |
- if: matrix.os == 'ubuntu-latest' | |
name: Deploy to Github Pages | |
uses: JamesIves/[email protected] | |
with: | |
BRANCH: gh-pages | |
FOLDER: gh-page | |
SINGLE-COMMIT: true |