-
-
Notifications
You must be signed in to change notification settings - Fork 10
79 lines (71 loc) · 2.33 KB
/
ci.yaml
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
70
71
72
73
74
75
76
77
78
79
name: CI
env:
EXTRA_NIX_CONFIG: |
substituters = https://cache.nixos.org/ https://nix-community.cachix.org
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=
on:
pull_request:
branches:
- "trunk"
merge_group:
branches:
- "trunk"
permissions: {}
jobs:
emacs-versions:
runs-on: ubuntu-latest
outputs:
EMACS_VERSIONS: ${{ steps.set-emacs-versions.outputs.EMACS_VERSIONS }}
permissions:
contents: read
steps:
- uses: actions/checkout@v3.6.0
- uses: cachix/install-nix-action@v22
with:
github_access_token: '${{ secrets.GITHUB_TOKEN }}'
extra_nix_config: "${{ env.EXTRA_NIX_CONFIG }}"
- id: set-emacs-versions
run: |
EMACS_VERSIONS=$(nix eval --json .#supportedEmacsVersions)
echo "EMACS_VERSIONS=$EMACS_VERSIONS" >> "$GITHUB_OUTPUT"
file-changes:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
outputs:
package-sources: ${{ steps.changes.outputs.package-sources }}
test-sources: ${{ steps.changes.outputs.test-sources }}
nix-sources: ${{ steps.changes.outputs.nix-sources }}
steps:
- uses: actions/checkout@v3.6.0
- uses: dorny/paths-filter@v2
id: changes
with:
base: ${{ github.event.pull_request.base.ref || github.event.merge_group.base_ref }}
ref: ${{ github.event.pull_request.head.ref || github.event.merge_group.head_ref }}
filters: .github/file-filters.yaml
lint-package:
uses: ./.github/workflows/lint-package.yaml
permissions:
contents: read
needs: [emacs-versions, file-changes]
if: needs.file-changes.outputs.package-sources == 'true'
secrets: inherit
with:
emacs-versions: ${{ needs.emacs-versions.outputs.EMACS_VERSIONS }}
test-package:
uses: ./.github/workflows/test.yaml
permissions:
contents: read
needs: [emacs-versions, file-changes]
secrets: inherit
with:
emacs-versions: ${{ needs.emacs-versions.outputs.EMACS_VERSIONS }}
lint-nix:
uses: ./.github/workflows/lint-nix.yaml
if: needs.file-changes.outputs.nix-sources == 'true'
permissions:
contents: read
needs: file-changes
secrets: inherit