generated from AndreasAugustin/template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (66 loc) · 1.89 KB
/
test_docker_images.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
name: test-docker-images
on:
workflow_call:
inputs:
tag:
description: 'The docker image tag'
required: true
type: string
secrets:
DOCKERHUB_USERNAME:
description: 'The dockerhub username'
required: true
DOCKERHUB_TOKEN:
description: 'The dockerhub token'
required: true
workflow_dispatch:
inputs:
tag:
description: 'The docker image tag'
required: true
type: string
default: v0.2.8-alpha-amd64
permissions:
packages: read
jobs:
test-docker-images:
strategy:
matrix:
docker-image:
- ghcr.io/andreasaugustin/go-gitmoji-cli
- andyaugustin/go-gitmoji-cli
runs-on: ubuntu-latest
steps:
-
uses: actions/checkout@v4
with:
lfs: true
fetch-depth: 0
-
name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: pull image
run: |
docker pull ${{ matrix.docker-image }}:${{ inputs.tag }}
-
name: run tests
run: |
echo "Install container tools"
curl -LO https://storage.googleapis.com/container-structure-test/latest/container-structure-test-linux-amd64 \
&& chmod +x container-structure-test-linux-amd64 \
&& sudo mv container-structure-test-linux-amd64 /usr/local/bin/container-structure-test
echo "Run tests"
container-structure-test test \
--image ${{ matrix.docker-image }}:${{ inputs.tag }} \
--config tests/docker/test-config.yaml