|
1 | | -name: Pipeline PR push |
| 1 | +name: Pipeline PR push |
| 2 | + |
2 | 3 | on: |
3 | 4 | pull_request: |
4 | 5 |
|
5 | 6 | jobs: |
6 | | - build: |
7 | | - runs-on: ${{matrix.os}} |
8 | | - strategy: |
9 | | - matrix: |
10 | | - os: [ubuntu-latest, windows-latest, macOS-latest] |
| 7 | + # === LINUX === |
| 8 | + build-linux: |
| 9 | + runs-on: ubuntu-latest |
11 | 10 | steps: |
12 | 11 | - name: Checkout |
13 | 12 | uses: actions/checkout@v4 |
14 | 13 | with: |
15 | 14 | fetch-depth: 0 |
16 | | - |
| 15 | + |
| 16 | + - name: Cache NuGet packages |
| 17 | + uses: actions/cache@v4 |
| 18 | + with: |
| 19 | + path: ~/.nuget/packages |
| 20 | + key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} |
| 21 | + restore-keys: | |
| 22 | + ${{ runner.os }}-nuget- |
| 23 | +
|
17 | 24 | - name: Setup .NET 8 Environment |
18 | 25 | uses: actions/setup-dotnet@v4 |
19 | 26 | with: |
20 | 27 | dotnet-version: '8.0.x' |
21 | | - - name: Create config file for ByteSync.Client |
22 | | - run: echo '${{ secrets.CLIENT_LOCAL_SETTINGS_JSON}}' > src/ByteSync.Client/local.settings.json |
23 | | - |
| 28 | + |
| 29 | + - name: Create config file |
| 30 | + shell: bash |
| 31 | + run: echo '${{ secrets.CLIENT_LOCAL_SETTINGS_JSON }}' > src/ByteSync.Client/local.settings.json |
| 32 | + |
24 | 33 | - run: dotnet restore --locked-mode |
25 | 34 | - run: dotnet clean --verbosity quiet |
26 | 35 | - run: dotnet build --verbosity quiet /property:WarningLevel=0 |
27 | | - |
28 | | - test: |
29 | | - needs: build |
30 | | - runs-on: ${{matrix.os}} |
31 | | - strategy: |
32 | | - matrix: |
33 | | - os: [ubuntu-latest, windows-latest, macOS-latest] |
34 | | - steps: |
| 36 | + |
| 37 | + test-linux: |
| 38 | + needs: build-linux |
| 39 | + runs-on: ubuntu-latest |
| 40 | + steps: |
35 | 41 | - name: Checkout |
36 | 42 | uses: actions/checkout@v4 |
37 | 43 | with: |
38 | 44 | fetch-depth: 0 |
| 45 | + |
39 | 46 | - name: Setup .NET 8 Environment |
40 | 47 | uses: actions/setup-dotnet@v4 |
41 | 48 | with: |
42 | 49 | dotnet-version: '8.0.x' |
43 | | - |
| 50 | + |
44 | 51 | - run: dotnet restore --locked-mode |
45 | 52 |
|
46 | 53 | - name: Run Tests |
47 | | - run : dotnet test |
| 54 | + run: dotnet test --no-restore --no-build |
48 | 55 |
|
49 | | - - name: Upload Test Results as Artifacts |
| 56 | + - name: Upload Test Results |
50 | 57 | uses: actions/upload-artifact@v4 |
51 | 58 | with: |
52 | | - name: PR-test-results-${{matrix.os}} |
| 59 | + name: PR-test-results-linux |
53 | 60 | path: ./TestResults/*.trx |
54 | | - |
| 61 | + |
| 62 | + - name: Show Failed Tests |
| 63 | + if: failure() |
| 64 | + run: echo "Some tests failed. Check uploaded artifacts for detailed logs." |
| 65 | + |
| 66 | + |
| 67 | + # === macOS === |
| 68 | + build-mac: |
| 69 | + runs-on: macos-latest |
| 70 | + steps: |
| 71 | + - name: Checkout |
| 72 | + uses: actions/checkout@v4 |
| 73 | + with: |
| 74 | + fetch-depth: 0 |
| 75 | + |
| 76 | + - name: Cache NuGet packages |
| 77 | + uses: actions/cache@v4 |
| 78 | + with: |
| 79 | + path: ~/.nuget/packages |
| 80 | + key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} |
| 81 | + restore-keys: | |
| 82 | + ${{ runner.os }}-nuget- |
| 83 | +
|
| 84 | + - name: Setup .NET 8 Environment |
| 85 | + uses: actions/setup-dotnet@v4 |
| 86 | + with: |
| 87 | + dotnet-version: '8.0.x' |
| 88 | + |
| 89 | + - name: Create config file |
| 90 | + shell: bash |
| 91 | + run: echo '${{ secrets.CLIENT_LOCAL_SETTINGS_JSON }}' > src/ByteSync.Client/local.settings.json |
| 92 | + |
| 93 | + - run: dotnet restore --locked-mode |
| 94 | + - run: dotnet clean --verbosity quiet |
| 95 | + - run: dotnet build --verbosity quiet /property:WarningLevel=0 |
| 96 | + |
| 97 | + test-mac: |
| 98 | + needs: build-mac |
| 99 | + runs-on: macos-latest |
| 100 | + steps: |
| 101 | + - name: Checkout |
| 102 | + uses: actions/checkout@v4 |
| 103 | + with: |
| 104 | + fetch-depth: 0 |
| 105 | + |
| 106 | + - name: Setup .NET 8 Environment |
| 107 | + uses: actions/setup-dotnet@v4 |
| 108 | + with: |
| 109 | + dotnet-version: '8.0.x' |
| 110 | + |
| 111 | + - run: dotnet restore --locked-mode |
| 112 | + |
| 113 | + - name: Run Tests |
| 114 | + run: dotnet test --no-restore --no-build |
| 115 | + |
| 116 | + - name: Upload Test Results |
| 117 | + uses: actions/upload-artifact@v4 |
| 118 | + with: |
| 119 | + name: PR-test-results-mac |
| 120 | + path: ./TestResults/*.trx |
| 121 | + |
| 122 | + - name: Show Failed Tests |
| 123 | + if: failure() |
| 124 | + run: echo "Some tests failed. Check uploaded artifacts for detailed logs." |
| 125 | + |
| 126 | + |
| 127 | + # === WINDOWS === |
| 128 | + build-win: |
| 129 | + runs-on: windows-latest |
| 130 | + steps: |
| 131 | + - name: Checkout |
| 132 | + uses: actions/checkout@v4 |
| 133 | + with: |
| 134 | + fetch-depth: 0 |
| 135 | + |
| 136 | + - name: Cache NuGet packages |
| 137 | + uses: actions/cache@v4 |
| 138 | + with: |
| 139 | + path: C:\Users\runneradmin\.nuget\packages |
| 140 | + key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} |
| 141 | + restore-keys: | |
| 142 | + ${{ runner.os }}-nuget- |
| 143 | +
|
| 144 | + - name: Setup .NET 8 Environment |
| 145 | + uses: actions/setup-dotnet@v4 |
| 146 | + with: |
| 147 | + dotnet-version: '8.0.x' |
| 148 | + |
| 149 | + - name: Create config file |
| 150 | + shell: bash |
| 151 | + run: echo '${{ secrets.CLIENT_LOCAL_SETTINGS_JSON }}' > src/ByteSync.Client/local.settings.json |
| 152 | + |
| 153 | + - run: dotnet restore --locked-mode |
| 154 | + - run: dotnet clean --verbosity quiet |
| 155 | + - run: dotnet build --verbosity quiet /property:WarningLevel=0 |
| 156 | + |
| 157 | + test-win: |
| 158 | + needs: build-win |
| 159 | + runs-on: windows-latest |
| 160 | + steps: |
| 161 | + - name: Checkout |
| 162 | + uses: actions/checkout@v4 |
| 163 | + with: |
| 164 | + fetch-depth: 0 |
| 165 | + |
| 166 | + - name: Setup .NET 8 Environment |
| 167 | + uses: actions/setup-dotnet@v4 |
| 168 | + with: |
| 169 | + dotnet-version: '8.0.x' |
| 170 | + |
| 171 | + - run: dotnet restore --locked-mode |
| 172 | + |
| 173 | + - name: Run Tests |
| 174 | + run: dotnet test --no-restore --no-build |
| 175 | + |
| 176 | + - name: Upload Test Results |
| 177 | + uses: actions/upload-artifact@v4 |
| 178 | + with: |
| 179 | + name: PR-test-results-win |
| 180 | + path: ./TestResults/*.trx |
| 181 | + |
55 | 182 | - name: Show Failed Tests |
56 | 183 | if: failure() |
57 | 184 | run: echo "Some tests failed. Check uploaded artifacts for detailed logs." |
0 commit comments