This repository has been archived by the owner on May 19, 2024. It is now read-only.
forked from chezmoi-sh/atlas
-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (73 loc) · 3.16 KB
/
workflow_call.docker.validate.yaml
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
# Copyright 2024
#
# Everyone is permitted to copy, distribute, modify, merge, sell, publish,
# sublicense or whatever the fuck they want with this software but at their
# OWN RISK.
# The author has absolutely no fucking clue what the code in this project
# does. It might just fucking work or not, there is no third option.
#
# IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
---
name: 💚 Validate OCI Image
on:
workflow_call:
inputs:
application:
description: Path of the application to (re)build
type: string
required: true
env:
ASDF_DIR: /home/runner/.asdf
permissions: {}
jobs:
goss:
name: ✅ Check '${{ inputs.application }}' behavior
permissions:
checks: write
contents: read
runs-on: ubuntu-latest
steps:
- name: ⬇️ Checkout repository
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
# Install all required tools or restore them if the cache already exists
- name: 🚧 Restore cached tools
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
id: restore-asdf
with:
path: ${{ env.ASDF_DIR }}
key: asdf-vm-${{ hashFiles('.tool-versions') }}
- name: 📦️ Install required tools
uses: asdf-vm/actions/install@05e0d2ed97b598bfce82fd30daf324ae0c4570e6 # v3.0.2
with:
skip_install: ${{ steps.restore-asdf.outputs.cache-hit == 'true' }}
# Prepare the environment for the test
- name: 🚧 Setup QEMU environment
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0
- name: 🚧 Setup Docker Buildx
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0
- name: 🚧 Load `.envrc` context
run: direnv allow && direnv exec / direnv export gha >> "${GITHUB_ENV}"
# Run the tests
- name: 👷 Task docker:images:build (localhost/${{ inputs.application }}:ci)
run: |
task docker:images:build IMAGE=${{ inputs.application }} BUILD_TYPE=ci \
--output group \
--output-group-begin '::group::{{.TASK}} (${{ inputs.application }})' \
--output-group-end '::endgroup::'
- name: 🧪 Task docker:goss:run (localhost/${{ inputs.application }}:ci)
run: |
echo '::group::docker:goss:run (${{ inputs.application }})'
task docker:ci IMAGE=${{ inputs.application }} GOSS_OPTS="--format junit" \
> "apps/images/${{ inputs.application }}/dist/ci/goss-report.xml"
echo '::endgroup::'
- name: 📝 Upload Goss Test Report
uses: mikepenz/action-junit-report@9379f0ccddcab154835d4e2487555ee79614fe95 # v4.2.1
if: always()
with:
check_name: Goss Test Report (${{ inputs.application }})
commit: ${{ github.event.workflow_run.head_sha }}
include_passed: true
report_paths: apps/images/${{ inputs.application }}/dist/ci/goss-report.xml