Experiment with dotnet-script script for setup-mono #64
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Test | |
on: | |
push: | |
pull_request: | |
defaults: | |
run: | |
shell: pwsh | |
env: | |
DOTNET_TELEMETRY_OPTOUT: true | |
DOTNET_NOLOGO: true | |
NUGET_PACKAGES: ${{github.workspace}}/artifacts/pkg | |
# If new commits are pushed, don't bother finishing the current run. | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref || github.run_id }} | |
cancel-in-progress: true | |
# We'll have a job for building (that runs on x64 machines only, one for each OS to make sure it actually builds) | |
# Then, we'll take the result from one of those (probaly Linux) and distribute build artifacts to testers to run | |
# a load of tests. This will (eventually) include ARM runners, where possible. | |
jobs: | |
setup: | |
name: Setup | |
runs-on: ubuntu-latest | |
outputs: | |
should_skip: ${{ steps.skip_check.outputs.should_skip }} | |
ver: ${{ steps.computever.outputs.ver }} | |
matrix: ${{ steps.compute-matrix.outputs.matrix }} | |
steps: | |
- name: Check if this run should skip | |
id: skip_check | |
uses: fkirc/skip-duplicate-actions@v5 | |
with: | |
cancel_others: true | |
concurrent_skipping: same_content_newer | |
- name: Upload event file | |
uses: actions/upload-artifact@v4 | |
with: | |
name: test-event-file | |
path: ${{ github.event_path }} | |
retention-days: 1 | |
- name: Compute Version | |
id: computever | |
run: echo "ver=$(Get-Date -Format y.M.d).${{ github.run_number }}.${{ github.run_attempt }}" >> $env:GITHUB_OUTPUT | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
lfs: false | |
submodules: false | |
- name: Compute test matrix | |
id: compute-matrix | |
run: ./.github/gen-test-matrix.ps1 -MatrixOutName matrix -GithubOutput $env:GITHUB_OUTPUT | |
build-testassets: | |
needs: setup | |
if: needs.setup.outputs.should_skip != 'true' | |
name: 'Build #${{ needs.setup.outputs.ver }} (Linux)' | |
uses: ./.github/workflows/build.yml | |
with: | |
os: ubuntu-latest | |
osname: Linux | |
version: ${{ needs.setup.outputs.ver }} | |
upload-packages: true | |
upload-tests: true | |
build: | |
needs: setup | |
if: needs.setup.outputs.should_skip != 'true' | |
strategy: | |
matrix: | |
os: [windows-latest, macos-13] | |
include: | |
- os: windows-latest | |
name: Windows | |
- os: macos-13 | |
name: MacOS | |
name: 'Build #${{ needs.setup.outputs.ver }} (${{ matrix.name }})' | |
uses: ./.github/workflows/build.yml | |
with: | |
os: ${{ matrix.os }} | |
osname: ${{ matrix.name }} | |
version: ${{ needs.setup.outputs.ver }} | |
upload-packages: false | |
upload-tests: false | |
test: | |
needs: [setup, build-testassets] | |
if: needs.setup.outputs.should_skip != 'true' | |
strategy: | |
fail-fast: false | |
matrix: ${{ fromJSON(needs.setup.outputs.matrix) }} | |
uses: ./.github/workflows/test.yml | |
name: Test ${{ matrix.title }} | |
with: | |
matrix: ${{ toJSON(matrix) }} |