|
1 | 1 | name: .NET Core |
2 | 2 |
|
3 | | -on: |
| 3 | +on: |
4 | 4 | push: |
5 | 5 | branches: [ "develop", "release/*", "master" ] |
6 | 6 | pull_request: |
7 | 7 | branches: [ "develop", "release/*", "master" ] |
8 | 8 |
|
9 | 9 | jobs: |
10 | | - ubuntu-latest: |
11 | | - name: ubuntu-latest |
12 | | - runs-on: ubuntu-latest |
13 | | - steps: |
14 | | - - uses: actions/setup-dotnet@v2.1.0 |
15 | | - with: |
16 | | - dotnet-version: '5.0.x' |
17 | | - - uses: actions/setup-dotnet@v1 |
18 | | - with: |
19 | | - dotnet-version: '6.0.x' |
20 | | - - uses: actions/checkout@v2 |
21 | | - - name: 🔨 Use .NET 7.X SDK |
22 | | - uses: actions/setup-dotnet@v2.1.0 |
23 | | - with: |
24 | | - dotnet-version: '7.x' |
25 | | - - name: Install libgdiplus |
26 | | - run: sudo apt-get update && sudo apt-get install -y libgdiplus libc6-dev |
27 | | -# - name: t |
28 | | -# run: sudo ln -s /usr/lib/libgdiplus.so /usr/lib/gdiplus.dll |
29 | | -# - name: t1 |
30 | | -# run: sudo apt-get update && sudo apt-get install -y fontconfig |
31 | | - - name: Install libjpeg62 |
32 | | - run: sudo apt-get install libjpeg62 |
33 | | - - name: Restore with dotnet |
34 | | - run: dotnet restore |
35 | | - - name: Build with dotnet |
36 | | - run: dotnet build -c Release --no-restore |
37 | | - - name: Test with .NET 6.0.x |
38 | | - run: dotnet test src/Magicodes.ExporterAndImporter.Tests -f net6.0 |
39 | | - - name: Test with .NET 7.0.x |
40 | | - run: dotnet test src/Magicodes.ExporterAndImporter.Tests -f net7.0 |
41 | | - windows-latest: |
42 | | - name: windows-latest |
43 | | - runs-on: windows-latest |
44 | | - steps: |
45 | | - - uses: actions/setup-dotnet@v2.1.0 |
46 | | - with: |
47 | | - dotnet-version: '5.0.x' |
48 | | - - uses: actions/setup-dotnet@v1 |
49 | | - with: |
50 | | - dotnet-version: '6.0.x' |
51 | | - - uses: actions/checkout@v2 |
52 | | - - name: 🔨 Use .NET 7.X SDK |
53 | | - uses: actions/setup-dotnet@v2.1.0 |
54 | | - with: |
55 | | - dotnet-version: '7.x' |
56 | | - - name: Restore with dotnet |
57 | | - run: dotnet restore |
58 | | - - name: Build with dotnet |
59 | | - run: dotnet build -c Release --no-restore |
60 | | - - name: Test with dotnet |
61 | | - run: dotnet test src/Magicodes.ExporterAndImporter.Tests |
62 | | - macOS-latest: |
63 | | - name: macOS-latest |
64 | | - runs-on: macos-latest |
| 10 | + build-and-test: |
| 11 | + name: ${{ matrix.os }} |
| 12 | + runs-on: ${{ matrix.os }} |
| 13 | + strategy: |
| 14 | + fail-fast: false |
| 15 | + matrix: |
| 16 | + os: [ubuntu-latest, windows-latest, macos-latest] |
| 17 | + |
65 | 18 | steps: |
66 | | - - uses: actions/setup-dotnet@v2.1.0 |
67 | | - with: |
68 | | - dotnet-version: '5.0.x' |
69 | | - - uses: actions/setup-dotnet@v1 |
70 | | - with: |
71 | | - dotnet-version: '6.0.x' |
72 | | - - uses: actions/checkout@v2 |
73 | | - - name: 🔨 Use .NET 7.X SDK |
74 | | - uses: actions/setup-dotnet@v2.1.0 |
75 | | - with: |
76 | | - dotnet-version: '7.x' |
77 | | - - name: Restore with dotnet |
78 | | - run: dotnet restore |
79 | | - - name: Build with dotnet |
80 | | - run: dotnet build -c Release --no-restore |
81 | | - - name: Test with .NET 6.0.x |
82 | | - run: dotnet test src/Magicodes.ExporterAndImporter.Tests -f net6.0 |
83 | | - - name: Test with .NET 7.0.x |
84 | | - run: dotnet test src/Magicodes.ExporterAndImporter.Tests -f net7.0 |
| 19 | + - uses: actions/checkout@v4 |
| 20 | + |
| 21 | + - name: Setup .NET |
| 22 | + uses: actions/setup-dotnet@v4 |
| 23 | + with: |
| 24 | + dotnet-version: 10.0.x |
| 25 | + cache: true |
| 26 | + cache-dependency-path: | |
| 27 | + Magicodes.IE.sln |
| 28 | + src/**/*.csproj |
| 29 | +
|
| 30 | + - name: Install Linux dependencies |
| 31 | + if: runner.os == 'Linux' |
| 32 | + run: sudo apt-get update && sudo apt-get install -y libgdiplus libc6-dev libjpeg62 |
| 33 | + |
| 34 | + - name: Restore |
| 35 | + run: dotnet restore Magicodes.IE.sln |
| 36 | + |
| 37 | + - name: Build |
| 38 | + run: dotnet build Magicodes.IE.sln -c Release --no-restore |
| 39 | + |
| 40 | + - name: Test on Windows |
| 41 | + if: runner.os == 'Windows' |
| 42 | + run: dotnet test src/Magicodes.ExporterAndImporter.Tests/Magicodes.IE.Tests.csproj -c Release --no-build |
| 43 | + |
| 44 | + - name: Test on Linux and macOS - net8.0 |
| 45 | + if: runner.os != 'Windows' |
| 46 | + run: dotnet test src/Magicodes.ExporterAndImporter.Tests/Magicodes.IE.Tests.csproj -c Release --no-build -f net8.0 |
| 47 | + |
| 48 | + - name: Test on Linux and macOS - net10.0 |
| 49 | + if: runner.os != 'Windows' |
| 50 | + run: dotnet test src/Magicodes.ExporterAndImporter.Tests/Magicodes.IE.Tests.csproj -c Release --no-build -f net10.0 |
0 commit comments