-
Notifications
You must be signed in to change notification settings - Fork 4
69 lines (65 loc) · 2.85 KB
/
pages_coverage_preview.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
name: Coverage Preview Deploy
on:
# When a PR is merged (or force push to main)
pull_request:
types:
- opened
- reopened
- synchronize
- closed
- labeled
- unlabeled
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: write
pull-requests: write
concurrency: preview-cov-${{ github.ref }}
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
# -=-=-=-= Create report =-=-=-=-
- uses: cachix/install-nix-action@v27
if: |
(github.event.action == 'labeled' && github.event.label.name == 'coverage') ||
(github.event.action != 'labeled' && github.event.action != 'unlabeled' && contains(github.event.pull_request.labels.*.name, 'coverage'))
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- uses: cachix/cachix-action@v14
if: |
(github.event.action == 'labeled' && github.event.label.name == 'coverage') ||
(github.event.action != 'labeled' && github.event.action != 'unlabeled' && contains(github.event.pull_request.labels.*.name, 'coverage'))
with:
name: dlr-ft
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: Generate report(s)
if: |
(github.event.action == 'labeled' && github.event.label.name == 'coverage') ||
(github.event.action != 'labeled' && github.event.action != 'unlabeled' && contains(github.event.pull_request.labels.*.name, 'coverage'))
run: nix build .#report --print-build-logs
# -=-=-=-= Deploy (when labeled) =-=-=-=-
- name: Deploy Preview (labeled)
if: ${{ github.event.action == 'labeled' && github.event.label.name == 'coverage' }}
uses: rossjrw/[email protected]
with:
source-dir: result/coverage/html/
umbrella-dir: coverage/pr-preview
action: deploy # force deployment since, by default, this actions does nothing on the 'labeled' event
# -=-=-=-= Deploy (when unlabeled) =-=-=-=-
- name: Deploy Preview (unlabeled)
if: ${{ github.event.action == 'unlabeled' && github.event.label.name == 'coverage' }}
uses: rossjrw/[email protected]
with:
source-dir: result/coverage/html/
umbrella-dir: coverage/pr-preview
action: remove # force removal since, by default, this actions does nothing on the 'labeled' event
# -=-=-=-= Deploy (default) =-=-=-=-
- name: Deploy Preview (default)
if: ${{ github.event.action != 'labeled' && github.event.action != 'unlabeled' && contains(github.event.pull_request.labels.*.name, 'coverage') }}
uses: rossjrw/[email protected]
with:
source-dir: result/coverage/html/
umbrella-dir: coverage/pr-preview