-
Notifications
You must be signed in to change notification settings - Fork 2
58 lines (50 loc) · 1.58 KB
/
goss-tests.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
name: goss-tests
run-name: Execute Goss tests
env:
REGISTRY: ghcr.io
on:
workflow_run:
workflows: ["Build and deploy Bay images"]
types: [completed]
jobs:
goss-test:
runs-on: ubuntu-latest
strategy:
matrix:
images: ["bay-php_goss"]
type:
- php
steps:
- uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Extract Docker metadata
id: meta
uses: docker/[email protected]
with:
images: |
${{ env.REGISTRY }}/${{ github.repository }}/${{ matrix.images }}
tags: |
type=ref,event=branch
- name: Clean ref_name
id: sanitise-ref-name
run: |
echo "SANITISED-REF-NAME=${{ github.ref_name }}" | tr '/' '-' >> "$GITHUB_OUTPUT"
- name: Build and push
uses: docker/build-push-action@v4
with:
push: false
context: ./images/bay-php_goss
load: true
tags: ${{ steps.meta.outputs.tags }}
build-args: |
BASE_IMAGE=${{ env.REGISTRY }}/${{ github.repository }}/php-cli:${{ steps.sanitise-ref-name.outputs.SANITISED-REF-NAME }}
- name: Install Goss
uses: e1himself/[email protected]
- name: Execute Goss tests
working-directory: ./tests
run: |
ls -al .
GOSS_FILES_STRATEGY=cp GOSS_FILE=goss.${{ matrix.type }}_goss.yaml bash -c 'dgoss run -i ${{ steps.meta.outputs.tags }}'