forked from CenterForOpenScience/modular-file-renderer
-
Notifications
You must be signed in to change notification settings - Fork 5
71 lines (60 loc) · 1.64 KB
/
unit-tests.yml
File metadata and controls
71 lines (60 loc) · 1.64 KB
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
name: Unit Tests
on:
push:
branches-ignore:
- '[0-9]*'
pull_request:
branches: [ master, develop ]
jobs:
build-image:
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
image: ${{ steps.meta.outputs.image }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build Docker image
id: build
run: |
docker build -t rdm-mfr-test:${{ github.sha }} -f ./Dockerfile .
- name: Save Docker image
run: |
docker save rdm-mfr-test:${{ github.sha }} -o /tmp/rdm-mfr-image.tar
- name: Upload Docker image artifact
uses: actions/upload-artifact@v4
with:
name: rdm-mfr-image
path: /tmp/rdm-mfr-image.tar
retention-days: 1
- name: Export image reference
id: meta
run: echo "image=rdm-mfr-test:${{ github.sha }}" >> "$GITHUB_OUTPUT"
tests:
runs-on: ubuntu-latest
needs: build-image
permissions:
contents: read
timeout-minutes: 90
strategy:
fail-fast: false
matrix:
test_build: [mfr]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download Docker image artifact
uses: actions/download-artifact@v4
with:
name: rdm-mfr-image
path: /tmp
- name: Load Docker image
run: |
docker load -i /tmp/rdm-mfr-image.tar
- name: Run matrix job
env:
TEST_BUILD: ${{ matrix.test_build }}
MFR_TEST_IMAGE: ${{ needs.build-image.outputs.image }}
run: |
bash .github/scripts/ci/run-tests.sh "$TEST_BUILD"