|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + paths-ignore: |
| 6 | + - 'docs/**' |
| 7 | + - '**.md' |
| 8 | + pull_request: |
| 9 | + paths-ignore: |
| 10 | + - 'docs/**' |
| 11 | + - '**.md' |
| 12 | + |
| 13 | +env: |
| 14 | + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true |
| 15 | + dotnet_sdk_version: '2.1.500' |
| 16 | + build_configuration: Release |
| 17 | + |
| 18 | +jobs: |
| 19 | + build-windows: |
| 20 | + runs-on: windows-latest |
| 21 | + steps: |
| 22 | + - uses: actions/checkout@v1 |
| 23 | + - name: Setup .NET Core |
| 24 | + uses: actions/setup-dotnet@v1 |
| 25 | + with: |
| 26 | + dotnet-version: ${{ env.dotnet_sdk_version }} |
| 27 | + - run: dotnet --info |
| 28 | + - name: Install and run nbgv |
| 29 | + run: | |
| 30 | + dotnet tool install --tool-path . nbgv |
| 31 | + ./nbgv get-version -p src |
| 32 | + - name: Restore |
| 33 | + run: dotnet restore src -v normal |
| 34 | + - name: Build |
| 35 | + run: dotnet build src -t:build,pack --no-restore -m -c ${{ env.build_configuration }} |
| 36 | + - name: Test |
| 37 | + run: dotnet test src --no-build -c ${{ env.build_configuration }} |
| 38 | + - name: Upload nugets |
| 39 | + if: github.event_name == 'push' |
| 40 | + uses: actions/upload-artifact@v1 |
| 41 | + with: |
| 42 | + name: nugets |
| 43 | + path: bin/Packages/${{ env.build_configuration }} |
| 44 | + |
| 45 | + build-other: |
| 46 | + strategy: |
| 47 | + matrix: |
| 48 | + os: [ubuntu-latest, macos-latest] |
| 49 | + env: |
| 50 | + project_path: 'src/CodeGeneration.Roslyn.Tests' |
| 51 | + runs-on: ${{ matrix.os }} |
| 52 | + steps: |
| 53 | + - uses: actions/checkout@v1 |
| 54 | + - name: Setup .NET Core |
| 55 | + uses: actions/setup-dotnet@v1 |
| 56 | + with: |
| 57 | + dotnet-version: ${{ env.dotnet_sdk_version }} |
| 58 | + - run: dotnet --info |
| 59 | + - name: Install and run nbgv |
| 60 | + run: | |
| 61 | + dotnet tool install --tool-path . nbgv |
| 62 | + ./nbgv get-version -p src |
| 63 | + - name: Restore |
| 64 | + run: dotnet restore ${{ env.project_path }} -v normal |
| 65 | + - name: Build |
| 66 | + run: dotnet build ${{ env.project_path }} --no-restore -m -c ${{ env.build_configuration }} -f netcoreapp2.1 |
| 67 | + - name: Test |
| 68 | + run: dotnet test ${{ env.project_path }} --no-build -c ${{ env.build_configuration }} -f netcoreapp2.1 |
0 commit comments