|
8 | 8 | paths-ignore: ["docs/**"] |
9 | 9 | jobs: |
10 | 10 | build-init: |
11 | | - # this job initialises the vagrant box |
12 | | - # then just runs some initial ansible tasks |
13 | | - # for the full build, see build.yml |
14 | | - runs-on: macos-latest |
15 | | - env: |
16 | | - VAGRANT_NO_GUI: true |
17 | | - VAGRANT_ON_GH: true |
| 11 | + # this job tests ansible provisioning in Docker containers |
| 12 | + # Tests on both ARM64 and AMD64 architectures using Ubuntu runners |
| 13 | + runs-on: ${{ matrix.os }} |
| 14 | + strategy: |
| 15 | + matrix: |
| 16 | + os: [ubuntu-latest] |
18 | 17 |
|
19 | 18 | steps: |
20 | 19 | - uses: actions/checkout@v4 |
21 | | - - name: set up Python |
| 20 | + |
| 21 | + - name: Set up Python |
22 | 22 | uses: actions/setup-python@v5 |
23 | 23 | with: |
24 | | - python-version: 3.9 |
| 24 | + python-version: 3.13 |
25 | 25 |
|
26 | | - - name: install pip requirements |
| 26 | + - name: Install pip requirements |
27 | 27 | run: | |
28 | 28 | pip install --upgrade pip |
29 | 29 | pip install wheel |
30 | 30 | pip install -r requirements.txt |
31 | 31 |
|
32 | | - - name: install ansible requirements |
| 32 | + - name: Install Ansible requirements |
33 | 33 | run: ansible-galaxy install -r requirements.yml |
34 | 34 |
|
35 | | - - name: Build Vagrant Box |
36 | | - run: ANSIBLE_ARGS="--tags init,ci_test" vagrant up |
| 35 | + - name: Install Docker collection for CI |
| 36 | + run: ansible-galaxy collection install community.docker |
| 37 | + |
| 38 | + - name: Start Ubuntu Docker container |
| 39 | + run: | |
| 40 | + docker run -d --name quantum-mobile \ |
| 41 | + -v ${{ github.workspace }}:/workspace \ |
| 42 | + ubuntu:24.04 \ |
| 43 | + sleep infinity |
| 44 | +
|
| 45 | + - name: Prepare container for Ansible |
| 46 | + run: | |
| 47 | + docker exec quantum-mobile bash -c " |
| 48 | + apt-get update && |
| 49 | + apt-get install -y python3 sudo systemd |
| 50 | + " |
| 51 | +
|
| 52 | + - name: Run Ansible provisioning |
| 53 | + run: ansible-playbook --limit docker-ci -e build_hosts=docker-ci --tags init,ci_test playbook-build.yml |
37 | 54 |
|
38 | 55 | - name: Archive ansible log |
| 56 | + if: always() |
39 | 57 | uses: actions/upload-artifact@v4 |
40 | 58 | with: |
41 | | - name: ansible-log |
| 59 | + name: ansible-log-${{ matrix.os }} |
42 | 60 | path: ansible.log |
0 commit comments