Skip to content

Commit 67e4bff

Browse files
committed
Modernize CI
1 parent 63ad4c9 commit 67e4bff

2 files changed

Lines changed: 74 additions & 26 deletions

File tree

.github/workflows/ci.yml

Lines changed: 37 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ on:
1111
env:
1212
version: 0.4.19_git
1313
OPENSSL_VERSION: 4.0.0
14+
HOMEBREW_NO_AUTO_UPDATE: 1
1415

1516
jobs:
1617
build:
@@ -89,21 +90,44 @@ jobs:
8990
echo "PKG_CONFIG_PATH=$HOME/openssl-4/lib64/pkgconfig:$HOME/openssl-4/lib/pkgconfig" >> $GITHUB_ENV
9091
echo "LD_LIBRARY_PATH=$HOME/openssl-4/lib64:$HOME/openssl-4/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" >> $GITHUB_ENV
9192
92-
- name: Install brew dependencies (macOS)
93+
- name: Remove unused Homebrew taps (macOS)
9394
if: runner.os == 'macOS'
9495
run: |
95-
brew install libtool automake opensc softhsm
96+
# GitHub-hosted macOS images may include unrelated third-party taps
97+
# that trigger trust warnings on every brew command.
98+
brew untap --force aws/tap azure/bicep hashicorp/tap >/dev/null 2>&1 || true
99+
100+
- name: Install brew build dependencies (macOS)
101+
if: runner.os == 'macOS'
102+
run: |
103+
for package in libtool automake; do
104+
if ! brew list --versions "$package" >/dev/null; then
105+
brew install "$package"
106+
fi
107+
done
108+
109+
- name: Install brew test dependencies (macOS)
110+
if: runner.os == 'macOS' && matrix.id != 'macOS-4'
111+
run: |
112+
for package in opensc softhsm; do
113+
if ! brew list --versions "$package" >/dev/null; then
114+
brew install "$package"
115+
fi
116+
done
96117
97118
- name: Install OpenSSL 4 (macOS-4 only)
98119
if: runner.os == 'macOS' && matrix.id == 'macOS-4'
99120
run: |
100-
brew update
101-
brew install openssl@4
121+
if ! brew list --versions openssl@4 >/dev/null; then
122+
brew install --quiet openssl@4
123+
fi
102124
103125
- name: Install OpenSSL 3 (macOS-3 only)
104126
if: runner.os == 'macOS' && matrix.id == 'macOS-3'
105127
run: |
106-
brew install openssl@3
128+
if ! brew list --versions openssl@3 >/dev/null; then
129+
brew install openssl@3
130+
fi
107131
108132
- name: Set environment variables (macOS)
109133
if: runner.os == 'macOS'
@@ -114,8 +138,8 @@ jobs:
114138
115139
- name: System information
116140
run: |
117-
which pkcs11-tool
118-
which softhsm2-util
141+
which pkcs11-tool || true
142+
which softhsm2-util || true
119143
which openssl
120144
openssl version -a
121145
echo "PATH=$PATH"
@@ -146,25 +170,25 @@ jobs:
146170
build_for: 'WIN32'
147171
compiler: vs
148172
arch: x86
149-
os: windows-latest
173+
os: windows-2022
150174
generator: Ninja
151175
vcpkg_root: C:/vcpkg
152176
- id: windows-x64-vs
153177
triplet: x64-windows
154178
build_for: 'WIN64'
155179
compiler: vs
156180
arch: x64
157-
os: windows-latest
181+
os: windows-2022
158182
generator: Ninja
159183
vcpkg_root: C:/vcpkg
160184

161-
runs-on: windows-latest
185+
runs-on: ${{matrix.os}}
162186

163187
steps:
164188
- uses: actions/checkout@v5
165189

166190
- name: Cache the vcpkg archives
167-
uses: actions/cache@v4
191+
uses: actions/cache@v5
168192
with:
169193
path: C:/Users/runneradmin/AppData/Local/vcpkg/archives
170194
key: ${{matrix.id}}-${{hashFiles('vcpkg.json')}}
@@ -173,7 +197,7 @@ jobs:
173197
${{matrix.id}}-
174198
175199
- name: Configure Visual Studio
176-
uses: ilammy/msvc-dev-cmd@v1
200+
uses: TheMrMilchmann/setup-msvc-dev@v4
177201
with:
178202
arch: ${{matrix.arch}}
179203

@@ -191,7 +215,7 @@ jobs:
191215
OPENSSL_DIR="C:\vcpkg\packages\openssl_${{matrix.triplet}}"
192216

193217
- name: Upload the DLLs
194-
uses: actions/upload-artifact@v4
218+
uses: actions/upload-artifact@v6
195219
with:
196220
name: libp11-${{env.version}}-${{matrix.arch}}
197221
path: ${{github.workspace}}/src/*.dll

.github/workflows/ci.yml.in

Lines changed: 37 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ on:
1111
env:
1212
version: @PACKAGE_VERSION@
1313
OPENSSL_VERSION: 4.0.0
14+
HOMEBREW_NO_AUTO_UPDATE: 1
1415

1516
jobs:
1617
build:
@@ -89,21 +90,44 @@ jobs:
8990
echo "PKG_CONFIG_PATH=$HOME/openssl-4/lib64/pkgconfig:$HOME/openssl-4/lib/pkgconfig" >> $GITHUB_ENV
9091
echo "LD_LIBRARY_PATH=$HOME/openssl-4/lib64:$HOME/openssl-4/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" >> $GITHUB_ENV
9192

92-
- name: Install brew dependencies (macOS)
93+
- name: Remove unused Homebrew taps (macOS)
9394
if: runner.os == 'macOS'
9495
run: |
95-
brew install libtool automake opensc softhsm
96+
# GitHub-hosted macOS images may include unrelated third-party taps
97+
# that trigger trust warnings on every brew command.
98+
brew untap --force aws/tap azure/bicep hashicorp/tap >/dev/null 2>&1 || true
99+
100+
- name: Install brew build dependencies (macOS)
101+
if: runner.os == 'macOS'
102+
run: |
103+
for package in libtool automake; do
104+
if ! brew list --versions "$package" >/dev/null; then
105+
brew install "$package"
106+
fi
107+
done
108+
109+
- name: Install brew test dependencies (macOS)
110+
if: runner.os == 'macOS' && matrix.id != 'macOS-4'
111+
run: |
112+
for package in opensc softhsm; do
113+
if ! brew list --versions "$package" >/dev/null; then
114+
brew install "$package"
115+
fi
116+
done
96117

97118
- name: Install OpenSSL 4 (macOS-4 only)
98119
if: runner.os == 'macOS' && matrix.id == 'macOS-4'
99120
run: |
100-
brew update
101-
brew install openssl@4
121+
if ! brew list --versions openssl@4 >/dev/null; then
122+
brew install --quiet openssl@4
123+
fi
102124

103125
- name: Install OpenSSL 3 (macOS-3 only)
104126
if: runner.os == 'macOS' && matrix.id == 'macOS-3'
105127
run: |
106-
brew install openssl@3
128+
if ! brew list --versions openssl@3 >/dev/null; then
129+
brew install openssl@3
130+
fi
107131

108132
- name: Set environment variables (macOS)
109133
if: runner.os == 'macOS'
@@ -114,8 +138,8 @@ jobs:
114138

115139
- name: System information
116140
run: |
117-
which pkcs11-tool
118-
which softhsm2-util
141+
which pkcs11-tool || true
142+
which softhsm2-util || true
119143
which openssl
120144
openssl version -a
121145
echo "PATH=$PATH"
@@ -146,25 +170,25 @@ jobs:
146170
build_for: 'WIN32'
147171
compiler: vs
148172
arch: x86
149-
os: windows-latest
173+
os: windows-2022
150174
generator: Ninja
151175
vcpkg_root: C:/vcpkg
152176
- id: windows-x64-vs
153177
triplet: x64-windows
154178
build_for: 'WIN64'
155179
compiler: vs
156180
arch: x64
157-
os: windows-latest
181+
os: windows-2022
158182
generator: Ninja
159183
vcpkg_root: C:/vcpkg
160184

161-
runs-on: windows-latest
185+
runs-on: ${{matrix.os}}
162186

163187
steps:
164188
- uses: actions/checkout@v5
165189

166190
- name: Cache the vcpkg archives
167-
uses: actions/cache@v4
191+
uses: actions/cache@v5
168192
with:
169193
path: C:/Users/runneradmin/AppData/Local/vcpkg/archives
170194
key: ${{matrix.id}}-${{hashFiles('vcpkg.json')}}
@@ -173,7 +197,7 @@ jobs:
173197
${{matrix.id}}-
174198

175199
- name: Configure Visual Studio
176-
uses: ilammy/msvc-dev-cmd@v1
200+
uses: TheMrMilchmann/setup-msvc-dev@v4
177201
with:
178202
arch: ${{matrix.arch}}
179203

@@ -191,7 +215,7 @@ jobs:
191215
OPENSSL_DIR="C:\vcpkg\packages\openssl_${{matrix.triplet}}"
192216

193217
- name: Upload the DLLs
194-
uses: actions/upload-artifact@v4
218+
uses: actions/upload-artifact@v6
195219
with:
196220
name: libp11-${{env.version}}-${{matrix.arch}}
197221
path: ${{github.workspace}}/src/*.dll

0 commit comments

Comments
 (0)