-
Notifications
You must be signed in to change notification settings - Fork 5
219 lines (192 loc) · 8.49 KB
/
containers.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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
name: Containers
on:
workflow_dispatch:
inputs:
inpcont:
description: 'Build containers'
required: true
type: choice
options:
- 'yes'
- 'no'
default: 'yes'
inpwhichcont:
description: 'Which containers to build, defaults to "all".'
required: false
default: 'all'
type: string
inpmani:
description: 'Update manifest'
required: true
type: choice
options:
- 'yes'
- 'no'
default: 'yes'
inpweb:
description: 'Update website'
required: true
type: choice
options:
- 'yes'
- 'no'
default: 'yes'
schedule:
- cron: '55 5 * * *'
jobs:
# ------------------------------------------------------------------------
setup-matrix:
if: ${{ github.event.inputs.inpcont == '' || github.event.inputs.inpcont == 'yes' }}
runs-on: ubuntu-latest
outputs:
config: ${{ steps.setup-matrix.outputs.config }}
steps:
- uses: actions/checkout@v4
- name: Set up matrix of containers
id: setup-matrix
run: |
config=$(python tests/get-containers.py ${{ github.event.inputs.inpwhichcont }})
echo "config=$config" >> $GITHUB_OUTPUT
# ------------------------------------------------------------------------
containers:
if: ${{ github.event.inputs.inpcont == '' || github.event.inputs.inpcont == 'yes' }}
needs: setup-matrix
strategy:
fail-fast: false
matrix:
config: ${{ fromJson(needs.setup-matrix.outputs.config) }}
runs-on: ubuntu-latest
name: ${{ matrix.config.container }}
steps:
# needed for bigger Docker images, if there isn't enough space, then
# they build, but are not exported to Docker
- name: "Clean up"
run: |
sudo rm -rf /usr/share/dotnet /opt/ghc /usr/local/.ghcup \
/usr/local/share/boost \
$AGENT_TOOLSDIRECTORY $CONDA $VCPKG_INSTALLATION_ROOT \
$JAVA_HOME_8_X64 $JAVA_HOME_11_X64 $JAVA_HOME_17_X64 $JAVA_HOME_21_X64 \
$CHROMEWEBDRIVER $EDGEWEBDRIVER $GECKOWEBDRIVER $SELENIUM_JAR_PATH \
$ANDROID_HOME
sudo apt-get remove -y '^aspnetcore-.*' || echo "::warning::The command [sudo apt-get remove -y '^aspnetcore-.*'] failed to complete successfully. Proceeding..."
sudo apt-get remove -y '^dotnet-.*' --fix-missing || echo "::warning::The command [sudo apt-get remove -y '^dotnet-.*' --fix-missing] failed to complete successfully. Proceeding..."
sudo apt-get remove -y '^llvm-.*' --fix-missing || echo "::warning::The command [sudo apt-get remove -y '^llvm-.*' --fix-missing] failed to complete successfully. Proceeding..."
sudo apt-get remove -y 'php.*' --fix-missing || echo "::warning::The command [sudo apt-get remove -y 'php.*' --fix-missing] failed to complete successfully. Proceeding..."
sudo apt-get remove -y '^mongodb-.*' --fix-missing || echo "::warning::The command [sudo apt-get remove -y '^mongodb-.*' --fix-missing] failed to complete successfully. Proceeding..."
sudo apt-get remove -y '^mysql-.*' --fix-missing || echo "::warning::The command [sudo apt-get remove -y '^mysql-.*' --fix-missing] failed to complete successfully. Proceeding..."
sudo apt-get remove -y azure-cli google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri --fix-missing || echo "::warning::The command [sudo apt-get remove -y azure-cli google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri --fix-missing] failed to complete successfully. Proceeding..."
sudo apt-get remove -y google-cloud-sdk --fix-missing || echo "::debug::The command [sudo apt-get remove -y google-cloud-sdk --fix-missing] failed to complete successfully. Proceeding..."
sudo apt-get remove -y google-cloud-cli --fix-missing || echo "::debug::The command [sudo apt-get remove -y google-cloud-cli --fix-missing] failed to complete successfully. Proceeding..."
sudo apt-get autoremove -y || echo "::warning::The command [sudo apt-get autoremove -y] failed to complete successfully. Proceeding..."
sudo apt-get clean || echo "::warning::The command [sudo apt-get clean] failed to complete successfully. Proceeding..."
df -h /
docker buildx du
- uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Install Qemu
uses: docker/setup-qemu-action@v3
with:
image: tonistiigi/binfmt:qemu-v8.1.5
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build
uses: docker/build-push-action@v5
with:
platforms: ${{ matrix.config.testplatform || 'linux/amd64' }}
secret-envs: |
REDHAT_ORG_RHEL7=REDHAT_ORG_RHEL7
REDHAT_ORG_RHEL8=REDHAT_ORG_RHEL8
REDHAT_ORG_RHEL9=REDHAT_ORG_RHEL9
REDHAT_ACTIVATION_KEY_RHEL7=REDHAT_ACTIVATION_KEY_RHEL7
REDHAT_ACTIVATION_KEY_RHEL8=REDHAT_ACTIVATION_KEY_RHEL8
REDHAT_ACTIVATION_KEY_RHEL9=REDHAT_ACTIVATION_KEY_RHEL9
provenance: false
context: containers/${{ matrix.config.container }}
load: true
tags: |
rhub/test:test
env:
REDHAT_ORG_RHEL7: ${{ secrets.REDHAT_ORG }}
REDHAT_ORG_RHEL8: ${{ secrets.REDHAT_ORG }}
REDHAT_ORG_RHEL9: ${{ secrets.REDHAT_ORG }}
REDHAT_ACTIVATION_KEY_RHEL7: ${{ secrets.REDHAT_ACTIVATION_KEY_RHEL7 }}
REDHAT_ACTIVATION_KEY_RHEL8: ${{ secrets.REDHAT_ACTIVATION_KEY_RHEL8 }}
REDHAT_ACTIVATION_KEY_RHEL9: ${{ secrets.REDHAT_ACTIVATION_KEY_RHEL9 }}
- name: Test
run: |
docker run rhub/test:test R --version
docker run rhub/test:test sh -c '$(R CMD config CC) --version'
docker run rhub/test:test sh -c '$(R CMD config CXX) --version'
docker run rhub/test:test sh -c '$(R CMD config FC) --version'
- name: Push
uses: docker/build-push-action@v5
with:
platforms: ${{ matrix.config.platform || 'linux/amd64' }}
secret-envs: |
REDHAT_ORG_RHEL7=REDHAT_ORG_RHEL7
REDHAT_ORG_RHEL8=REDHAT_ORG_RHEL8
REDHAT_ORG_RHEL9=REDHAT_ORG_RHEL9
REDHAT_ACTIVATION_KEY_RHEL7=REDHAT_ACTIVATION_KEY_RHEL7
REDHAT_ACTIVATION_KEY_RHEL8=REDHAT_ACTIVATION_KEY_RHEL8
REDHAT_ACTIVATION_KEY_RHEL9=REDHAT_ACTIVATION_KEY_RHEL9
provenance: false
context: containers/${{ matrix.config.container }}
push: true
outputs:
tags: |
rhub/${{ matrix.config.container }}:latest
ghcr.io/r-hub/containers/${{ matrix.config.container }}:latest
env:
REDHAT_ORG_RHEL7: ${{ secrets.REDHAT_ORG }}
REDHAT_ORG_RHEL8: ${{ secrets.REDHAT_ORG }}
REDHAT_ORG_RHEL9: ${{ secrets.REDHAT_ORG }}
REDHAT_ACTIVATION_KEY_RHEL7: ${{ secrets.REDHAT_ACTIVATION_KEY_RHEL7 }}
REDHAT_ACTIVATION_KEY_RHEL8: ${{ secrets.REDHAT_ACTIVATION_KEY_RHEL8 }}
REDHAT_ACTIVATION_KEY_RHEL9: ${{ secrets.REDHAT_ACTIVATION_KEY_RHEL9 }}
# ------------------------------------------------------------------------
website:
if: ${{ (github.event.inputs.inpweb == '' || github.event.inputs.inpweb == 'yes') && !cancelled() }}
runs-on: ubuntu-latest
needs: containers
name: Update website
# Rule out parallel updates.
concurrency:
group: website
steps:
- uses: actions/checkout@v4
- name: Install Qemu
uses: docker/setup-qemu-action@v3
with:
image: tonistiigi/binfmt:qemu-v8.1.5
- name: Install quarto
uses: quarto-dev/quarto-actions/setup@v2
- name: Install R
uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
- name: Install R packages
uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::pkgload
working-directory: website
- name: Build manifest
run: cd website && Rscript update-manifest.R
env:
UPDATE_MANIFEST: ${{ github.event.inputs.inpmani }}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
- uses: quarto-dev/quarto-actions/publish@v2
with:
path: website
target: gh-pages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}