|
| 1 | +name: Tests |
| 2 | + |
| 3 | + |
| 4 | +on: |
| 5 | + pull_request: |
| 6 | + paths-ignore: |
| 7 | + - 'README.md' |
| 8 | + - '.editorconfig' |
| 9 | + push: |
| 10 | + paths-ignore: |
| 11 | + - 'README.md' |
| 12 | + - '.editorconfig' |
| 13 | + branches: |
| 14 | + - main |
| 15 | + - master |
| 16 | + - '[0-9]+.[0-9]+' |
| 17 | + - '[0-9]+.x' |
| 18 | + |
| 19 | +jobs: |
| 20 | + unit-tests: |
| 21 | + name: Unit |
| 22 | + runs-on: ubuntu-latest |
| 23 | + steps: |
| 24 | + - name: Checkout |
| 25 | + uses: actions/checkout@v2 |
| 26 | + - uses: actions/setup-dotnet@v1 |
| 27 | + with: |
| 28 | + dotnet-version: '5.0.100' |
| 29 | + - uses: actions/cache@v2 |
| 30 | + with: |
| 31 | + path: ~/.nuget/packages |
| 32 | + key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} |
| 33 | + restore-keys: | |
| 34 | + ${{ runner.os }}-nuget- |
| 35 | +
|
| 36 | + - run: ./build.sh test --report |
| 37 | + name: Test |
| 38 | + - name: Test Results |
| 39 | + if: always() |
| 40 | + uses: mikepenz/action-junit-report@v2 |
| 41 | + with: |
| 42 | + report_paths: 'build/output/junit-*.xml' |
| 43 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 44 | + fail_on_failure: true |
| 45 | + require_tests: true |
| 46 | + check_name: Unit Test Results |
| 47 | + |
| 48 | + # Packages nuget packages first and then uses the nuget packages to test |
| 49 | + # Also builds versioned nuget packages |
| 50 | + canary-tests: |
| 51 | + name: Canary |
| 52 | + runs-on: ubuntu-latest |
| 53 | + steps: |
| 54 | + - name: Checkout |
| 55 | + uses: actions/checkout@v2 |
| 56 | + - uses: actions/setup-dotnet@v1 |
| 57 | + with: |
| 58 | + dotnet-version: '5.0.100' |
| 59 | + - uses: actions/cache@v2 |
| 60 | + with: |
| 61 | + path: ~/.nuget/packages |
| 62 | + key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} |
| 63 | + restore-keys: | |
| 64 | + ${{ runner.os }}-nuget- |
| 65 | +
|
| 66 | + - run: ./build.sh canary --report |
| 67 | + name: Test |
| 68 | + - name: Test Results |
| 69 | + if: always() |
| 70 | + uses: mikepenz/action-junit-report@v2 |
| 71 | + with: |
| 72 | + report_paths: 'build/output/junit-*.xml' |
| 73 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 74 | + fail_on_failure: true |
| 75 | + require_tests: true |
| 76 | + check_name: Canary Test Results |
| 77 | + |
| 78 | + # Github packages requires authentication, this is likely going away in the future so for now we publish to feedz.io |
| 79 | + # Only runs on builds on heads |
| 80 | + - run: dotnet nuget push 'build/output/*.nupkg' -k ${{secrets.FEEDZ_IO_API_KEY}} -s https://f.feedz.io/elastic/all/nuget/index.json --skip-duplicate --no-symbols true |
| 81 | + name: publish canary packages to feedz.io |
| 82 | + if: github.event_name == 'push' && startswith(github.ref, 'refs/heads') |
| 83 | + |
0 commit comments