-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (79 loc) · 2.86 KB
/
test.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
---
name: Test
"on":
workflow_call:
inputs:
continue-on-error:
type: boolean
description: Allow a workflow run to pass when this workflow fails
required: false
default: false
jobs:
set-platforms:
name: Set platforms
runs-on: ubuntu-latest
outputs:
platforms: ${{ steps.set-platforms.outputs.result }}
steps:
- name: Checkout
# yamllint disable-line rule:line-length
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set platforms
id: set-platforms
uses: mikefarah/yq@bbdd97482f2d439126582a59689eb1c855944955 # v4.44.3
with:
cmd: >
yq --output-format=json --indent=0
'[.platforms[].name]'
ansible/molecule/default/molecule.yml
test:
name: Test
runs-on: ubuntu-latest
needs: set-platforms
continue-on-error: ${{ inputs.continue-on-error }}
strategy:
matrix:
platform: ${{ fromJson(needs.set-platforms.outputs.platforms) }}
steps:
# GitHub Actions hosted runners provide around 21GB of free storage, but
# the instances need around 25GB. This action frees up an additional
# 24GB, giving us a total of 45GB, which is enough disk space to run each
# VM.
- name: Free disk space
# yamllint disable-line rule:line-length
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
- name: Checkout
# yamllint disable-line rule:line-length
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup just
# yamllint disable-line rule:line-length
uses: extractions/setup-just@dd310ad5a97d8e7b41793f8ef055398d51ad4de6 # v2.0.0
with:
# renovate: datasource=crate depName=just
just-version: 1.36.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install Python
# yamllint disable-line rule:line-length
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
# renovate: datasource=docker depName=python versioning=docker
python-version: 3.13.0
cache: pip
- name: Update apt
run: sudo apt update
- name: Install dependencies
run: |
sudo apt install vagrant virtualbox
just install-dependencies
- name: Cache Vagrant boxes
# yamllint disable-line rule:line-length
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: ~/.vagrant.d/boxes
key: "${{ runner.os }}-\
vagrant-\
${{ hashFiles('ansible/molecule/default/molecule.yml') }}"
restore-keys: ${{ runner.os }}-vagrant-
- name: Test
run: just test --platform-name=${{ matrix.platform }}