-
-
Notifications
You must be signed in to change notification settings - Fork 14
112 lines (98 loc) · 3.54 KB
/
Copy pathci.yml
File metadata and controls
112 lines (98 loc) · 3.54 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
---
# Managed by modulesync - DO NOT EDIT
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/
name: 🚦 CI
# yamllint disable-line rule:truthy
on:
pull_request:
branches:
- main
workflow_dispatch:
concurrency:
group: ci-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
setup-matrix:
name: Set up build matrix
runs-on: ubuntu-latest
outputs:
build-matrix: ${{ steps.build-matrix.outputs.build-matrix }}
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Install yq
uses: dcarbone/install-yq-action@v1.3.1
- name: Generate build matrix
id: build-matrix
run: echo "build-matrix=$(yq -o=json build_platforms.yaml | jq -c)" >> "$GITHUB_OUTPUT"
build-container:
name: Build ${{ matrix.platform }} CI container
runs-on: ${{ matrix.runner }}
needs:
- setup-matrix
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.setup-matrix.outputs.build-matrix) }}
permissions:
actions: read
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Build image
uses: docker/build-push-action@v7
with:
context: .
file: Containerfile
tags: 'ci/voxbox:${{ matrix.openvox_version }}'
push: false
platforms: linux/${{ matrix.platform }}
- name: Checkout test repository
uses: actions/checkout@v7
with:
repository: voxpupuli/puppet-example
- name: Test image
run: |
docker run --rm -v "$PWD:/repo:Z" ci/voxbox:${{ matrix.openvox_version }}
docker run --rm -v "$PWD:/repo:Z" ci/voxbox:${{ matrix.openvox_version }} lint
docker run --rm -v "$PWD:/repo:Z" ci/voxbox:${{ matrix.openvox_version }} metadata_lint
docker run --rm -v "$PWD:/repo:Z" ci/voxbox:${{ matrix.openvox_version }} r10k:dependencies
docker run --rm -v "$PWD:/repo:Z" ci/voxbox:${{ matrix.openvox_version }} r10k:syntax
docker run --rm -v "$PWD:/repo:Z" ci/voxbox:${{ matrix.openvox_version }} rubocop
docker run --rm -v "$PWD:/repo:Z" ci/voxbox:${{ matrix.openvox_version }} spec
docker run --rm -v "$PWD:/repo:Z" ci/voxbox:${{ matrix.openvox_version }} strings:validate:reference
docker run --rm -v "$PWD:/repo:Z" ci/voxbox:${{ matrix.openvox_version }} syntax
- name: Run post-test diagnostics
run: |
docker run --rm --entrypoint=ash ci/voxbox:${{ matrix.openvox_version }} -c "bundle check"
docker run --rm --entrypoint=ash ci/voxbox:${{ matrix.openvox_version }} -c "bundle env"
docker run --rm --entrypoint=ash ci/voxbox:${{ matrix.openvox_version }} -c "bundle outdated || true"
tests:
name: Test suite
if: always()
needs:
- setup-matrix
- build-container
runs-on: ubuntu-24.04
steps:
- name: Verify required jobs
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}
dependabot:
name: Dependabot auto-merge
if: github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'
needs:
- tests
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Enable auto-merge for Dependabot PR
env:
GH_TOKEN: ${{ github.token }}
PR_URL: ${{ github.event.pull_request.html_url }}
run: gh pr merge --auto --merge "$PR_URL"