1010 required : true
1111 type : string
1212
13- concurrency :
14- group : qemu-${{ github.event.pull_request.number || github.ref }}-${{ inputs.chip }}-${{ inputs.type }}
15- cancel-in-progress : true
16-
1713jobs :
1814 qemu-test :
1915 name : QEMU ${{ inputs.chip }} ${{ inputs.type }} tests
@@ -45,35 +41,48 @@ jobs:
4541
4642 echo "enabled=$enabled" >> $GITHUB_OUTPUT
4743
48- - name : Checkout repository
44+ - name : Checkout user repository
45+ if : ${{ steps.check-tests.outputs.enabled == 'true' }}
4946 uses : actions/checkout@v4
50- if : steps.check-tests.outputs.enabled == 'true'
5147 with :
5248 ref : ${{ github.event.pull_request.head.sha || github.sha }}
49+ persist-credentials : false
50+ sparse-checkout-cone-mode : false
51+ sparse-checkout : |
52+ /*
53+ !.github
54+
55+ # To avoid giving unknown scripts elevated permissions, download them from the master branch
56+ - name : Get CI scripts from master
57+ if : ${{ steps.check-tests.outputs.enabled == 'true' }}
58+ run : |
59+ mkdir -p .github
60+ cd .github
61+ curl https://codeload.github.com/${{ github.repository }}/tar.gz/master | tar -xz --strip=2 arduino-esp32-master/.github
5362
5463 - uses : actions/setup-python@v5
55- if : steps.check-tests.outputs.enabled == 'true'
64+ if : ${{ steps.check-tests.outputs.enabled == 'true' }}
5665 with :
5766 cache-dependency-path : tests/requirements.txt
5867 cache : ' pip'
5968 python-version : ' 3.x'
6069
6170 - name : Install Python dependencies
62- if : steps.check-tests.outputs.enabled == 'true'
71+ if : ${{ steps.check-tests.outputs.enabled == 'true' }}
6372 run : |
6473 pip install -U pip
6574 pip install -r tests/requirements.txt --extra-index-url https://dl.espressif.com/pypi
6675
6776 - name : Install APT dependencies
687769- if : steps.check-tests.outputs.enabled == 'true'
78+ if : ${{ steps.check-tests.outputs.enabled == 'true' }}
7079 with :
7180 packages : libpixman-1-0 libnuma1 libglib2.0-0 libslirp0 libsdl2-2.0-0
7281 version : 1.0
7382
7483 - name : Get QEMU version
7584 uses :
pozetroninc/[email protected] 76- if : steps.check-tests.outputs.enabled == 'true'
85+ if : ${{ steps.check-tests.outputs.enabled == 'true' }}
7786 id : get-qemu-version
7887 with :
7988 token : ${{secrets.GITHUB_TOKEN}}
@@ -84,14 +93,14 @@ jobs:
8493 - name : Cache QEMU
8594 id : cache-qemu
8695 uses : actions/cache@v4
87- if : steps.check-tests.outputs.enabled == 'true'
96+ if : ${{ steps.check-tests.outputs.enabled == 'true' }}
8897 with :
8998 path : |
9099 ~/qemu
91100 key : qemu-${{ steps.get-qemu-version.outputs.release }}-${{ hashFiles('.github/workflows/qemu.yml') }}
92101
93102 - name : Download QEMU
94- if : steps.cache-qemu.outputs.cache-hit != 'true' && steps.check-tests.outputs.enabled == 'true'
103+ if : ${{ steps.cache-qemu.outputs.cache-hit != 'true' && steps.check-tests.outputs.enabled == 'true' }}
95104 run : |
96105 cd ${{ env.QEMU_INSTALL_PATH }}
97106 underscore_release=$(echo ${{ steps.get-qemu-version.outputs.release }} | sed 's/\-/_/g')
@@ -103,7 +112,7 @@ jobs:
103112 echo "QEMU_PATH=${{ env.QEMU_INSTALL_PATH }}/qemu" >> $GITHUB_ENV
104113
105114 - name : Get binaries
106- if : steps.check-tests.outputs.enabled == 'true'
115+ if : ${{ steps.check-tests.outputs.enabled == 'true' }}
107116 id : cache-build-binaries
108117 uses : actions/cache/restore@v4
109118 with :
@@ -115,7 +124,7 @@ jobs:
115124 ~/.arduino/tests/**/build*.tmp/*.json
116125
117126 - name : Run Tests
118- if : steps.check-tests.outputs.enabled == 'true'
127+ if : ${{ steps.check-tests.outputs.enabled == 'true' }}
119128 run : QEMU_PATH="${{ env.QEMU_INSTALL_PATH }}" bash .github/scripts/tests_run.sh -c -type ${{inputs.type}} -t ${{inputs.chip}} -i 0 -m 1 -Q
120129
121130 - name : Upload ${{ inputs.chip }} ${{ inputs.type }} QEMU results as cache
0 commit comments