Skip to content

Commit 78b5ee8

Browse files
Revert "Update build-and-test.yml"
This reverts commit 8783097.
1 parent 8783097 commit 78b5ee8

File tree

1 file changed

+32
-89
lines changed

1 file changed

+32
-89
lines changed

.github/workflows/build-and-test.yml

Lines changed: 32 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -11,65 +11,21 @@ on:
1111
branches:
1212
- main
1313
- release/*
14-
types: [ opened, synchronize, reopened ]
15-
14+
types: [ labeled, opened, synchronize, reopened ]
1615
jobs:
17-
# Prime a single LFS cache and expose the exact key for the matrix
18-
WarmLFS:
19-
runs-on: ubuntu-latest
20-
outputs:
21-
lfs_key: ${{ steps.expose-key.outputs.lfs_key }}
22-
steps:
23-
- name: Git Config
24-
shell: bash
25-
run: |
26-
git config --global core.autocrlf false
27-
git config --global core.longpaths true
28-
29-
- name: Git Checkout
30-
uses: actions/checkout@v4
31-
with:
32-
fetch-depth: 0
33-
submodules: recursive
34-
35-
# Deterministic list of LFS object IDs, then compute a portable key:
36-
# - `git lfs ls-files -l` lists all tracked LFS objects with their SHA-256
37-
# - `awk '{print $1}'` extracts just the SHA field
38-
# - `sort` sorts in byte order (hex hashes sort the same everywhere)
39-
# This ensures the file content is identical regardless of OS or locale
40-
- name: Git Create LFS id list
41-
shell: bash
42-
run: git lfs ls-files -l | awk '{print $1}' | sort > .lfs-assets-id
43-
44-
- name: Git Expose LFS cache key
45-
id: expose-key
46-
shell: bash
47-
env:
48-
LFS_KEY: lfs-${{ hashFiles('.lfs-assets-id') }}-v1
49-
run: echo "lfs_key=$LFS_KEY" >> "$GITHUB_OUTPUT"
50-
51-
- name: Git Setup LFS Cache
52-
uses: actions/cache@v5
53-
with:
54-
path: .git/lfs
55-
key: ${{ steps.expose-key.outputs.lfs_key }}
56-
57-
- name: Git Pull LFS
58-
shell: bash
59-
run: git lfs pull
60-
6116
Build:
62-
needs: WarmLFS
6317
strategy:
6418
matrix:
19+
isARM:
20+
- ${{ contains(github.event.pull_request.labels.*.name, 'arch:arm32') || contains(github.event.pull_request.labels.*.name, 'arch:arm64') }}
6521
options:
6622
- os: ubuntu-latest
6723
framework: net7.0
6824
sdk: 7.0.x
6925
sdk-preview: true
7026
runtime: -x64
7127
codecov: false
72-
- os: macos-26
28+
- os: macos-13 # macos-latest runs on arm64 runners where libgdiplus is unavailable
7329
framework: net7.0
7430
sdk: 7.0.x
7531
sdk-preview: true
@@ -81,19 +37,18 @@ jobs:
8137
sdk-preview: true
8238
runtime: -x64
8339
codecov: false
84-
- os: ubuntu-22.04-arm
40+
- os: buildjet-4vcpu-ubuntu-2204-arm
8541
framework: net7.0
8642
sdk: 7.0.x
8743
sdk-preview: true
8844
runtime: -x64
8945
codecov: false
90-
9146
- os: ubuntu-latest
9247
framework: net6.0
9348
sdk: 6.0.x
9449
runtime: -x64
9550
codecov: false
96-
- os: macos-26
51+
- os: macos-13 # macos-latest runs on arm64 runners where libgdiplus is unavailable
9752
framework: net6.0
9853
sdk: 6.0.x
9954
runtime: -x64
@@ -103,32 +58,19 @@ jobs:
10358
sdk: 6.0.x
10459
runtime: -x64
10560
codecov: false
106-
- os: ubuntu-22.04-arm
107-
framework: net6.0
108-
sdk: 6.0.x
109-
runtime: -x64
110-
codecov: false
61+
exclude:
62+
- isARM: false
63+
options:
64+
os: buildjet-4vcpu-ubuntu-2204-arm
11165

112-
runs-on: ${{ matrix.options.os }}
66+
runs-on: ${{matrix.options.os}}
11367

11468
steps:
11569
- name: Install libgdi+, which is required for tests running on ubuntu
11670
if: ${{ contains(matrix.options.os, 'ubuntu') }}
11771
run: |
118-
sudo apt-get update
119-
sudo apt-get -y install libgdiplus libgif-dev libglib2.0-dev libcairo2-dev libtiff-dev libexif-dev
120-
121-
- name: Install libgdi+, which is required for tests running on macos
122-
if: ${{ contains(matrix.options.os, 'macos-26') }}
123-
run: |
124-
brew update
125-
brew install mono-libgdiplus
126-
# Create symlinks to make libgdiplus discoverable
127-
sudo mkdir -p /usr/local/lib
128-
sudo ln -sf $(brew --prefix)/lib/libgdiplus.dylib /usr/local/lib/libgdiplus.dylib
129-
# Verify installation
130-
ls -la $(brew --prefix)/lib/libgdiplus* || echo "libgdiplus not found in brew prefix"
131-
ls -la /usr/local/lib/libgdiplus* || echo "libgdiplus not found in /usr/local/lib"
72+
sudo apt-get update
73+
sudo apt-get -y install libgdiplus libgif-dev libglib2.0-dev libcairo2-dev libtiff-dev libexif-dev
13274
13375
- name: Git Config
13476
shell: bash
@@ -142,41 +84,38 @@ jobs:
14284
fetch-depth: 0
14385
submodules: recursive
14486

145-
# Use the warmed key from WarmLFS. Do not recompute or recreate .lfs-assets-id here.
87+
# See https://github.com/actions/checkout/issues/165#issuecomment-657673315
88+
- name: Git Create LFS FileList
89+
run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id
90+
14691
- name: Git Setup LFS Cache
147-
uses: actions/cache@v5
92+
uses: actions/cache@v3
93+
id: lfs-cache
14894
with:
14995
path: .git/lfs
150-
key: ${{ needs.WarmLFS.outputs.lfs_key }}
96+
key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}-v1
15197

15298
- name: Git Pull LFS
153-
shell: bash
15499
run: git lfs pull
155100

156101
- name: NuGet Install
157-
uses: NuGet/setup-nuget@v2
102+
uses: NuGet/setup-nuget@v1
158103

159104
- name: NuGet Setup Cache
160-
uses: actions/cache@v5
105+
uses: actions/cache@v3
161106
id: nuget-cache
162107
with:
163108
path: ~/.nuget
164109
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/*.props', '**/*.targets') }}
165110
restore-keys: ${{ runner.os }}-nuget-
166111

167112
- name: DotNet Setup
168-
if: ${{ matrix.options.sdk-preview != true }}
169-
uses: actions/setup-dotnet@v5
170-
with:
171-
dotnet-version: |
172-
6.0.x
173-
174-
- name: DotNet Setup Preview
175-
if: ${{ matrix.options.sdk-preview == true }}
176-
uses: actions/setup-dotnet@v5
113+
uses: actions/setup-dotnet@v4
177114
with:
178115
dotnet-version: |
116+
8.0.x
179117
7.0.x
118+
6.0.x
180119
181120
- name: DotNet Build
182121
if: ${{ matrix.options.sdk-preview != true }}
@@ -209,16 +148,19 @@ jobs:
209148
XUNIT_PATH: .\tests\ImageSharp.Tests # Required for xunit
210149

211150
- name: Export Failed Output
212-
uses: actions/upload-artifact@v6
151+
uses: actions/upload-artifact@v4
213152
if: failure()
214153
with:
215154
name: actual_output_${{ runner.os }}_${{ matrix.options.framework }}${{ matrix.options.runtime }}.zip
216155
path: tests/Images/ActualOutput/
217156

218157
Publish:
219158
needs: [Build]
159+
220160
runs-on: ubuntu-latest
161+
221162
if: (github.event_name == 'push')
163+
222164
steps:
223165
- name: Git Config
224166
shell: bash
@@ -233,10 +175,10 @@ jobs:
233175
submodules: recursive
234176

235177
- name: NuGet Install
236-
uses: NuGet/setup-nuget@v2
178+
uses: NuGet/setup-nuget@v1
237179

238180
- name: NuGet Setup Cache
239-
uses: actions/cache@v5
181+
uses: actions/cache@v3
240182
id: nuget-cache
241183
with:
242184
path: ~/.nuget
@@ -259,3 +201,4 @@ jobs:
259201
run: |
260202
dotnet nuget push .\artifacts\*.nupkg -k ${{secrets.NUGET_TOKEN}} -s https://api.nuget.org/v3/index.json --skip-duplicate
261203
dotnet nuget push .\artifacts\*.snupkg -k ${{secrets.NUGET_TOKEN}} -s https://api.nuget.org/v3/index.json --skip-duplicate
204+

0 commit comments

Comments
 (0)