@@ -45,35 +45,48 @@ jobs:
45
45
46
46
echo "enabled=$enabled" >> $GITHUB_OUTPUT
47
47
48
- - name : Checkout repository
48
+ - name : Checkout user repository
49
+ if : ${{ steps.check-tests.outputs.enabled == 'true' }}
49
50
uses : actions/checkout@v4
50
- if : steps.check-tests.outputs.enabled == 'true'
51
51
with :
52
52
ref : ${{ github.event.pull_request.head.sha || github.sha }}
53
+ persist-credentials : false
54
+ sparse-checkout-cone-mode : false
55
+ sparse-checkout : |
56
+ /*
57
+ !.github
58
+
59
+ # To avoid giving unknown scripts elevated permissions, download them from the master branch
60
+ - name : Get CI scripts from master
61
+ if : ${{ steps.check-tests.outputs.enabled == 'true' }}
62
+ run : |
63
+ mkdir -p .github
64
+ cd .github
65
+ curl https://codeload.github.com/${{ github.repository }}/tar.gz/master | tar -xz --strip=2 arduino-esp32-master/.github
53
66
54
67
- uses : actions/setup-python@v5
55
- if : steps.check-tests.outputs.enabled == 'true'
68
+ if : ${{ steps.check-tests.outputs.enabled == 'true' }}
56
69
with :
57
70
cache-dependency-path : tests/requirements.txt
58
71
cache : ' pip'
59
72
python-version : ' 3.x'
60
73
61
74
- name : Install Python dependencies
62
- if : steps.check-tests.outputs.enabled == 'true'
75
+ if : ${{ steps.check-tests.outputs.enabled == 'true' }}
63
76
run : |
64
77
pip install -U pip
65
78
pip install -r tests/requirements.txt --extra-index-url https://dl.espressif.com/pypi
66
79
67
80
- name : Install APT dependencies
68
81
69
- if : steps.check-tests.outputs.enabled == 'true'
82
+ if : ${{ steps.check-tests.outputs.enabled == 'true' }}
70
83
with :
71
84
packages : libpixman-1-0 libnuma1 libglib2.0-0 libslirp0 libsdl2-2.0-0
72
85
version : 1.0
73
86
74
87
- name : Get QEMU version
75
88
uses :
pozetroninc/[email protected]
76
- if : steps.check-tests.outputs.enabled == 'true'
89
+ if : ${{ steps.check-tests.outputs.enabled == 'true' }}
77
90
id : get-qemu-version
78
91
with :
79
92
token : ${{secrets.GITHUB_TOKEN}}
@@ -84,14 +97,14 @@ jobs:
84
97
- name : Cache QEMU
85
98
id : cache-qemu
86
99
uses : actions/cache@v4
87
- if : steps.check-tests.outputs.enabled == 'true'
100
+ if : ${{ steps.check-tests.outputs.enabled == 'true' }}
88
101
with :
89
102
path : |
90
103
~/qemu
91
104
key : qemu-${{ steps.get-qemu-version.outputs.release }}-${{ hashFiles('.github/workflows/qemu.yml') }}
92
105
93
106
- name : Download QEMU
94
- if : steps.cache-qemu.outputs.cache-hit != 'true' && steps.check-tests.outputs.enabled == 'true'
107
+ if : ${{ steps.cache-qemu.outputs.cache-hit != 'true' && steps.check-tests.outputs.enabled == 'true' }}
95
108
run : |
96
109
cd ${{ env.QEMU_INSTALL_PATH }}
97
110
underscore_release=$(echo ${{ steps.get-qemu-version.outputs.release }} | sed 's/\-/_/g')
@@ -103,7 +116,7 @@ jobs:
103
116
echo "QEMU_PATH=${{ env.QEMU_INSTALL_PATH }}/qemu" >> $GITHUB_ENV
104
117
105
118
- name : Get binaries
106
- if : steps.check-tests.outputs.enabled == 'true'
119
+ if : ${{ steps.check-tests.outputs.enabled == 'true' }}
107
120
id : cache-build-binaries
108
121
uses : actions/cache/restore@v4
109
122
with :
@@ -115,7 +128,7 @@ jobs:
115
128
~/.arduino/tests/**/build*.tmp/*.json
116
129
117
130
- name : Run Tests
118
- if : steps.check-tests.outputs.enabled == 'true'
131
+ if : ${{ steps.check-tests.outputs.enabled == 'true' }}
119
132
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
120
133
121
134
- name : Upload ${{ inputs.chip }} ${{ inputs.type }} QEMU results as cache
0 commit comments