|
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 | + # on both ARM64 (ubuntu) and AMD64 (macos) architectures |
| 13 | + runs-on: ${{ matrix.os }} |
| 14 | + strategy: |
| 15 | + matrix: |
| 16 | + os: [ubuntu-latest, macos-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 | + |
| 26 | + - name: Setup Docker (macOS only) |
| 27 | + if: runner.os == 'macOS' |
| 28 | + uses: douglascamata/setup-docker-macos-action@v1-alpha |
25 | 29 |
|
26 | | - - name: install pip requirements |
| 30 | + - name: Install pip requirements |
27 | 31 | run: | |
28 | 32 | pip install --upgrade pip |
29 | 33 | pip install wheel |
30 | 34 | pip install -r requirements.txt |
31 | 35 |
|
32 | | - - name: install ansible requirements |
| 36 | + - name: Install Ansible requirements |
33 | 37 | run: ansible-galaxy install -r requirements.yml |
34 | 38 |
|
35 | | - - name: Build Vagrant Box |
36 | | - run: ANSIBLE_ARGS="--tags init,ci_test" vagrant up |
| 39 | + - name: Start Ubuntu Docker container |
| 40 | + run: | |
| 41 | + docker run -d --name quantum-mobile \ |
| 42 | + -v ${{ github.workspace }}:/workspace \ |
| 43 | + ubuntu:24.04 \ |
| 44 | + sleep infinity |
| 45 | +
|
| 46 | + - name: Prepare container for Ansible |
| 47 | + run: | |
| 48 | + docker exec quantum-mobile bash -c " |
| 49 | + apt-get update && |
| 50 | + apt-get install -y python3 sudo systemd |
| 51 | + " |
| 52 | +
|
| 53 | + - name: Run Ansible provisioning |
| 54 | + run: | |
| 55 | + ansible-playbook -i .github/workflows/docker-inventory.yml \ |
| 56 | + --tags init,ci_test \ |
| 57 | + playbook-build.yml |
37 | 58 |
|
38 | 59 | - name: Archive ansible log |
| 60 | + if: always() |
39 | 61 | uses: actions/upload-artifact@v4 |
40 | 62 | with: |
41 | | - name: ansible-log |
| 63 | + name: ansible-log-${{ matrix.os }} |
42 | 64 | path: ansible.log |
0 commit comments