Skip to content

Commit e0870e3

Browse files
authored
Updated GitHub Actions to use native ARM runners (#401)
For faster CI.
1 parent 191f17d commit e0870e3

File tree

1 file changed

+51
-16
lines changed

1 file changed

+51
-16
lines changed

.github/workflows/ci.yml

Lines changed: 51 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@ jobs:
5959
strategy:
6060
max-parallel: 3
6161
matrix:
62-
architecture:
63-
- amd64
6462
ansible-version:
6563
- max
6664
molecule-scenario:
@@ -72,14 +70,7 @@ jobs:
7270
- fedora
7371
- opensuse
7472
include:
75-
- architecture: arm
76-
ansible-version: max
77-
molecule-scenario: ubuntu-arm32v7
78-
- architecture: arm64
79-
ansible-version: max
80-
molecule-scenario: ubuntu-arm64v8
81-
- architecture: amd64
82-
ansible-version: min
73+
- ansible-version: min
8374
molecule-scenario: default
8475

8576
steps:
@@ -106,13 +97,56 @@ jobs:
10697
path: .tox
10798
key: molecule-${{ hashFiles(format('requirements/ansible-{0}.txt', matrix.ansible-version)) }}-py${{ steps.setup-python.outputs.python-version}}
10899

109-
- name: Set up QEMU
110-
if: matrix.architecture != 'amd64'
111-
id: qemu
112-
uses: docker/setup-qemu-action@v3
100+
- name: Install tox
101+
run: pip3 install --no-compile -r requirements/tox.txt
102+
103+
- name: Molecule test
104+
run: tox --colored=yes run -e ansible-${{ matrix.ansible-version }} -- --scenario-name=${{ matrix.molecule-scenario }}
105+
106+
- name: Compact Molecule cache
107+
if: steps.molecule-cache.outputs.cache-hit != 'true'
108+
run: find .tox -name '__pycache__' -exec rm -rf {} +
109+
110+
- name: Compact tox cache
111+
if: steps.tox-cache.outputs.cache-hit != 'true'
112+
run: find ~/.cache/pip -name '__pycache__' -exec rm -rf {} +
113+
114+
test-arm:
115+
name: Molecule test ARM
116+
runs-on: ubuntu-24.04-arm
117+
118+
strategy:
119+
max-parallel: 3
120+
matrix:
121+
ansible-version:
122+
- max
123+
molecule-scenario:
124+
- ubuntu-arm32v7
125+
- ubuntu-arm64v8
126+
127+
steps:
128+
- name: Checkout
129+
uses: actions/checkout@v4
130+
131+
- name: Set up Python
132+
id: setup-python
133+
uses: actions/setup-python@v5
134+
with:
135+
python-version-file: '.python-version'
136+
137+
- name: Tox cache
138+
id: tox-cache
139+
uses: actions/cache@v4
113140
with:
114-
image: tonistiigi/binfmt:latest
115-
platforms: ${{ matrix.architecture }}
141+
path: ~/.cache/pip
142+
key: tox-${{ hashFiles('requirements/tox.txt') }}-py${{ steps.setup-python.outputs.python-version}}
143+
144+
- name: Molecule cache
145+
id: molecule-cache
146+
uses: actions/cache@v4
147+
with:
148+
path: .tox
149+
key: molecule-${{ hashFiles(format('requirements/ansible-{0}.txt', matrix.ansible-version)) }}-py${{ steps.setup-python.outputs.python-version}}
116150

117151
- name: Install tox
118152
run: pip3 install --no-compile -r requirements/tox.txt
@@ -135,6 +169,7 @@ jobs:
135169
needs:
136170
- lint
137171
- test
172+
- test-arm
138173
steps:
139174
- name: Check test matrix status
140175
run: "[[ '${{ needs.test.result }}' == 'success' ]] || exit 1"

0 commit comments

Comments
 (0)