Skip to content

Commit 0de5918

Browse files
committed
ci: update checkout and artifact actions
1 parent 38e6387 commit 0de5918

1 file changed

Lines changed: 54 additions & 11 deletions

File tree

.github/workflows/buildcommit.yml

Lines changed: 54 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,24 +35,67 @@ jobs:
3535
PLATFORM_PREFIX: ${{matrix.platformtools}}
3636
EMULATOR: ${{matrix.emulator}}
3737
steps:
38-
- uses: actions/checkout@v4
38+
- uses: actions/checkout@v6.0.2
3939
- name: install multilib
40-
run: sudo apt-get install --no-install-recommends -y gcc-multilib g++-multilib
40+
run: |
41+
set -euxo pipefail
42+
retry() {
43+
local n=0
44+
until "$@"; do
45+
n=$((n+1))
46+
if [ "$n" -ge 3 ]; then
47+
return 1
48+
fi
49+
sleep $((n*5))
50+
done
51+
}
52+
retry sudo apt-get -o Acquire::Retries=5 update
53+
retry sudo apt-get install --no-install-recommends -y gcc-multilib g++-multilib
4154
if: ${{ matrix.name == 'i386' }}
4255
- name: install qemu
4356
if: matrix.emulator
44-
run: sudo apt-get install --no-install-recommends -y qemu-user
57+
run: |
58+
set -euxo pipefail
59+
retry() {
60+
local n=0
61+
until "$@"; do
62+
n=$((n+1))
63+
if [ "$n" -ge 3 ]; then
64+
return 1
65+
fi
66+
sleep $((n*5))
67+
done
68+
}
69+
retry sudo apt-get -o Acquire::Retries=5 update
70+
retry sudo apt-get install --no-install-recommends -y qemu-user
4571
- name: install abi lib
4672
if: matrix.platformtools
47-
run: sudo apt-get install --no-install-recommends -y gcc-${{matrix.platformtools}} g++-${{matrix.platformtools}}
73+
run: |
74+
set -euxo pipefail
75+
retry() {
76+
local n=0
77+
until "$@"; do
78+
n=$((n+1))
79+
if [ "$n" -ge 3 ]; then
80+
return 1
81+
fi
82+
sleep $((n*5))
83+
done
84+
}
85+
retry sudo apt-get -o Acquire::Retries=5 update
86+
if ! retry sudo apt-get install --no-install-recommends -y gcc-${{matrix.platformtools}} g++-${{matrix.platformtools}}; then
87+
# Mirrorlist/indexes can lag on ubuntu-latest; refresh and retry with --fix-missing.
88+
retry sudo apt-get -o Acquire::Retries=5 update
89+
retry sudo apt-get install --no-install-recommends -y --fix-missing gcc-${{matrix.platformtools}} g++-${{matrix.platformtools}}
90+
fi
4891
- name: make
4992
run: make all
5093
- name: test
5194
run: make test
5295
- name: set abi name
5396
run: echo abiname=$(make abiname) >> $GITHUB_ENV
5497
- name: Upload build artifacts
55-
uses: actions/upload-artifact@v4
98+
uses: actions/upload-artifact@v7.0.0
5699
with:
57100
name: ${{ env.abiname }}
58101
path: lib/${{ env.abiname }}/libstackman.a
@@ -70,7 +113,7 @@ jobs:
70113
abi: darwin_arm64
71114

72115
steps:
73-
- uses: actions/checkout@v4
116+
- uses: actions/checkout@v6.0.2
74117

75118
- name: Build library
76119
run: make all
@@ -79,7 +122,7 @@ jobs:
79122
run: make test
80123

81124
- name: Upload artifacts
82-
uses: actions/upload-artifact@v4
125+
uses: actions/upload-artifact@v7.0.0
83126
with:
84127
name: ${{ matrix.abi }}
85128
path: lib/${{ matrix.abi }}/libstackman.a
@@ -100,7 +143,7 @@ jobs:
100143
folder: arm64
101144

102145
steps:
103-
- uses: actions/checkout@v4
146+
- uses: actions/checkout@v6.0.2
104147
- uses: microsoft/setup-msbuild@v2
105148
- name: build
106149
run: msbuild.exe vs2022\stackman.sln /p:Platform=${{matrix.platform}}
@@ -112,7 +155,7 @@ jobs:
112155
if: ${{ matrix.native == 'yes' }}
113156
run: vs2022\${{matrix.folder}}\Debug\test.exe
114157
- name: Upload build artifacts
115-
uses: actions/upload-artifact@v4
158+
uses: actions/upload-artifact@v7.0.0
116159
with:
117160
name: win_${{ matrix.platform }}
118161
path: lib/win_${{matrix.platform}}/stackman.lib
@@ -122,7 +165,7 @@ jobs:
122165
needs: [build-linux-gnu, build-macos, build-windows]
123166
if: false # Disabled - libraries no longer committed to repository
124167
steps:
125-
- uses: actions/checkout@v4
168+
- uses: actions/checkout@v6.0.2
126169
- uses: actions/download-artifact@v4
127170
with:
128171
path: lib
@@ -143,7 +186,7 @@ jobs:
143186
permissions:
144187
contents: write
145188
steps:
146-
- uses: actions/checkout@v4
189+
- uses: actions/checkout@v6.0.2
147190

148191
- name: Download all artifacts
149192
uses: actions/download-artifact@v4

0 commit comments

Comments
 (0)