-
Notifications
You must be signed in to change notification settings - Fork 8
/
nix-action.yml.mustache
69 lines (67 loc) · 2.48 KB
/
nix-action.yml.mustache
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# 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:
{{# ci_cron_schedule }}
schedule:
- cron: '{{ ci_cron_schedule }}'
{{/ ci_cron_schedule }}
push:
branches:
- {{branch}}{{^branch}}master{{/branch}}
pull_request:
paths:
- .github/workflows/**
pull_request_target:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
overrides:
{{# tested_coq_nix_versions }}
- 'coq = "{{ coq_version }}"{{# extra_dev_dependencies }}; {{ nix_name }} = "{{ dev_version }}{{^ dev_version }}master{{/ dev_version }}"{{/ extra_dev_dependencies }}'
{{/ tested_coq_nix_versions }}{{^ tested_coq_nix_versions }} - 'coq = "master"'
{{/ tested_coq_nix_versions }}
fail-fast: false
steps:
- name: Determine which commit to test
run: |
{{! Change delimiters to avoid the curly brackets on the following lines being parsed as mustache syntax. }}
{{=<% %>=}}
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
<%# cachix %>
- uses: cachix/cachix-action@v12
with:
name: <% name %>
<%# push %>
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
<%/ push %>
<%/ cachix %><%^ cachix %> - uses: cachix/cachix-action@v12
with:
name: coq-community
<%# community %>
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
<%/ community %>
extraPullNames: coq, math-comp
<%/ cachix %>
- uses: actions/checkout@v3
with:
ref: ${{ env.tested_commit }}
<%# submodule %>
submodules: recursive
<%/ submodule %>
- run: >
nix-build https://github.com/coq-community/coq-nix-toolbox/archive/master.tar.gz --argstr job <% shortname %> --arg override '{ ${{ matrix.overrides }}; <% shortname %> = builtins.filterSource (path: _: baseNameOf path != ".git") ./.; }'