-
Notifications
You must be signed in to change notification settings - Fork 181
158 lines (151 loc) · 4.54 KB
/
reports.yml
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
name: Report published images
on:
push:
branches:
- "master"
paths:
- "build/reports/*.Rmd"
pull_request:
branches:
- "master"
paths:
- "build/reports/*.Rmd"
workflow_run:
workflows:
- "Build & Push Core images"
- "Build & Push extra images"
- "Build & Push experimental images"
branches:
- "master"
types:
- completed
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
jobs:
generate_matrix:
runs-on: ubuntu-latest
outputs:
matrix-main: ${{ steps.set-matrix.outputs.matrix-main }}
matrix-extra: ${{ steps.set-matrix.outputs.matrix-extra }}
steps:
- uses: actions/[email protected]
- id: set-matrix
run: |
CONTENT_MAIN="$(jq -r 'tostring' build/matrix/all.json)"
CONTENT_EXTRA="$(jq -s -r '.[0] + { group: [.[1].group[] | keys[] | select(. != "default")] } | tostring' build/matrix/latest-two.json build/templates/bakefiles/extra.docker-bake.json)"
echo "matrix-main=${CONTENT_MAIN}" >> "$GITHUB_OUTPUT"
echo "matrix-extra=${CONTENT_EXTRA}" >> "$GITHUB_OUTPUT"
echo "${CONTENT_MAIN}"
inspect-main:
needs: generate_matrix
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix: ${{fromJson(needs.generate_matrix.outputs.matrix-main)}}
steps:
- uses: actions/[email protected]
- name: Clean up
run: |
docker image prune --all --force
- name: Pull images
run: |
BAKE_JSON="bakefiles/${{ matrix.r_version }}.docker-bake.json" \
BAKE_GROUP="${{ matrix.group }}" \
make pull-image-group
- name: Inspect built image
run: |
IMAGELIST_NAME="${{ matrix.r_version }}-${{ matrix.group }}.tsv" \
make inspect-image-all
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: tmp
path: tmp
inspect-extra:
needs: generate_matrix
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix: ${{fromJson(needs.generate_matrix.outputs.matrix-extra)}}
steps:
- uses: actions/checkout@v4
- name: Clean up
run: |
docker image prune --all --force
- name: Pull images
run: |
BAKE_JSON="bakefiles/${{ matrix.r_version }}.extra.docker-bake.json" \
BAKE_GROUP="${{ matrix.group }}" \
make pull-image-group
- name: Inspect built image
run: |
IMAGELIST_NAME="${{ matrix.r_version }}-extra-${{ matrix.group }}.tsv" \
make inspect-image-all
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: tmp
path: tmp
inspect-experimental:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Clean up
run: |
docker image prune --all --force
- name: Pull images
run: |
BAKE_JSON="bakefiles/experimental.docker-bake.json" \
BAKE_GROUP="default" \
make pull-image-group
- name: Inspect built image
run: |
IMAGELIST_NAME="experimental.tsv" \
make inspect-image-all
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: tmp
path: tmp
publish_reports:
if: always()
needs:
- inspect-main
- inspect-extra
- inspect-experimental
runs-on: ubuntu-latest
container:
image: rocker/tidyverse:latest
steps:
- name: Checkout main
uses: actions/[email protected]
- name: Set as safe for following git commands
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Checkout wiki
uses: actions/[email protected]
with:
repository: "${{ github.repository }}.wiki"
path: reports
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: tmp
path: tmp
- name: Generate reports and update wiki home
run: |
make --jobs=2 report-all
make --always-make wiki-home
- name: Upload artifacts
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@v3
with:
name: reports
path: reports
- name: Update wiki
if: github.event_name != 'pull_request'
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Automated update
repository: reports