-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (43 loc) · 1.29 KB
/
DockerTest.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
name: Test Docker Images
on:
workflow_call:
pull_request:
push:
branches: [ "latest" ]
jobs:
build:
runs-on: ubuntu-latest
name: Test Images
strategy:
fail-fast: false
matrix:
slurm-version: [ "20.11.9", "22.05.2", "22.05.11", "23.02.5" ]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Docker image
uses: docker/build-push-action@v5
with:
load: true
tags: test-image
build-args: SLURM_VERSION=${{ matrix.slurm-version }}
- name: Test container is restartable
run: |
docker container create --name rerun_test_container test-image
docker container start -i rerun_test_container
docker container start -i rerun_test_container
docker container rm rerun_test_container
- name: Run bats tests
run: docker run -i -v $(pwd)/tests:/tests test-image bats /tests
# Use this job for branch protection rules
report-test-status:
name: Report Test Status
runs-on: ubuntu-latest
needs: build
if: always()
steps:
- name: Check build status
if: ${{ contains(needs.*.result, 'failure') }}
run: exit 1