update nix-action from templates #20
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
# This file was generated from `meta.yml`, please do not edit manually. | |
# Follow the instructions on https://github.com/coq-community/templates to regenerate. | |
name: Nix CI | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
paths: | |
- .github/workflows/** | |
pull_request_target: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
overrides: | |
- 'coq = "master"' | |
fail-fast: false | |
steps: | |
- name: Determine which commit to test | |
run: | | |
if [[ ${{ github.event_name }} =~ "pull_request" ]]; then | |
merge_commit=$(git ls-remote ${{ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge | cut -f1) | |
if [ -z "$merge_commit" ]; then | |
echo "tested_commit=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV | |
else | |
echo "tested_commit=$merge_commit" >> $GITHUB_ENV | |
fi | |
else | |
echo "tested_commit=${{ github.sha }}" >> $GITHUB_ENV | |
fi | |
- uses: cachix/install-nix-action@v20 | |
with: | |
nix_path: nixpkgs=channel:nixpkgs-unstable | |
- uses: cachix/cachix-action@v12 | |
with: | |
name: coq-community | |
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' | |
extraPullNames: coq, math-comp | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ env.tested_commit }} | |
- run: > | |
nix-build https://github.com/coq-community/coq-nix-toolbox/archive/master.tar.gz --argstr job almost-full --arg override '{ ${{ matrix.overrides }}; almost-full = builtins.filterSource (path: _: baseNameOf path != ".git") ./.; }' |