Skip to content

Commit 9197bee

Browse files
committed
ci: switch builds to use matrix
1 parent cf32f2a commit 9197bee

File tree

1 file changed

+24
-76
lines changed

1 file changed

+24
-76
lines changed

.github/workflows/build.yml

Lines changed: 24 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,26 @@
11
name: Build
2-
on: [push, pull_request]
2+
on: [ push, pull_request ]
33

4-
jobs:
5-
build-win-x64:
6-
runs-on: windows-latest
7-
steps:
8-
- uses: actions/checkout@v2
9-
- uses: actions/setup-dotnet@v1
10-
with:
11-
dotnet-version: '3.1.x'
12-
- name: Build
13-
run: |
14-
cd VisualPinball.Engine.Mpf
15-
dotnet build -c Release -r win-x64
16-
# - name: Test
17-
# run: |
18-
# cd VisualPinball.Engine.Mpf.Test
19-
# dotnet run -c Release -r win-x64
20-
- run: |
21-
mkdir tmp
22-
xcopy /E /I VisualPinball.Engine.Mpf.Unity\Plugins\win-x64 tmp\win-x64
23-
- uses: actions/upload-artifact@v2
24-
with:
25-
name: Plugins
26-
path: tmp
27-
28-
build-win-x86:
29-
runs-on: windows-latest
30-
steps:
31-
- uses: actions/checkout@v2
32-
- uses: actions/setup-dotnet@v1
33-
with:
34-
dotnet-version: '3.1.x'
35-
- name: Build
36-
run: |
37-
cd VisualPinball.Engine.Mpf
38-
dotnet build -c Release -r win-x86
39-
# - name: Test
40-
# run: |
41-
# cd VisualPinball.Engine.Mpf.Test
42-
# dotnet run -c Release -r win-x86
43-
- run: |
44-
mkdir tmp
45-
xcopy /E /I VisualPinball.Engine.Mpf.Unity\Plugins\win-x86 tmp\win-x86
46-
- uses: actions/upload-artifact@v2
47-
with:
48-
name: Plugins
49-
path: tmp
50-
51-
build-osx-x64:
52-
runs-on: macos-latest
53-
steps:
54-
- uses: actions/checkout@v2
55-
- uses: actions/setup-dotnet@v1
56-
with:
57-
dotnet-version: '3.1.x'
58-
- name: Build
59-
run: |
60-
cd VisualPinball.Engine.Mpf
61-
dotnet build -c Release -r osx-x64
62-
# - name: Test
63-
# run: |
64-
# cd VisualPinball.Engine.Mpf.Test
65-
# dotnet run -c Release -r osx-x64
66-
- run: |
67-
mkdir tmp
68-
cp -r VisualPinball.Engine.Mpf.Unity/Plugins/osx-x64 tmp
69-
- uses: actions/upload-artifact@v2
70-
with:
71-
name: Plugins
72-
path: tmp
4+
defaults:
5+
run:
6+
shell: bash
737

74-
build-linux-x64:
75-
runs-on: ubuntu-latest
8+
jobs:
9+
build:
10+
name: Build ${{ matrix.rid }}
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
include:
16+
- os: windows-latest
17+
rid: win-x64
18+
- os: windows-latest
19+
rid: win-x86
20+
- os: macos-latest
21+
rid: osx-x64
22+
- os: ubuntu-latest
23+
rid: linux-x64
7624
steps:
7725
- uses: actions/checkout@v2
7826
- uses: actions/setup-dotnet@v1
@@ -81,22 +29,22 @@ jobs:
8129
- name: Build
8230
run: |
8331
cd VisualPinball.Engine.Mpf
84-
dotnet build -c Release -r linux-x64
32+
dotnet build -c Release -r ${{ matrix.rid }}
8533
# - name: Test
8634
# run: |
8735
# cd VisualPinball.Engine.Mpf.Test
88-
# dotnet run -c Release -r linux-x64
36+
# dotnet run -c Release -r ${{ matrix.rid }}
8937
- run: |
9038
mkdir tmp
91-
cp -r VisualPinball.Engine.Mpf.Unity/Plugins/linux-x64 tmp
39+
cp -r VisualPinball.Engine.Mpf.Unity/Plugins/${{ matrix.rid }} tmp
9240
- uses: actions/upload-artifact@v2
9341
with:
9442
name: Plugins
9543
path: tmp
9644

9745
dispatch:
9846
runs-on: ubuntu-latest
99-
needs: [ build-win-x64, build-win-x86, build-osx-x64, build-linux-x64 ]
47+
needs: [ build ]
10048
if: github.repository == 'VisualPinball/VisualPinball.Engine.Mpf' && github.ref == 'refs/heads/master' && github.event_name == 'push'
10149
steps:
10250
- uses: peter-evans/repository-dispatch@v1

0 commit comments

Comments
 (0)