Cleanups to the repo #50
This file contains hidden or 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: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| permissions: | |
| contents: read | |
| # This allows a subsequently queued workflow run to interrupt previous runs | |
| concurrency: | |
| group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' | |
| cancel-in-progress: true | |
| jobs: | |
| build-and-test: | |
| strategy: | |
| matrix: | |
| include: | |
| - os: windows-latest | |
| target: x86_64-pc-windows-msvc | |
| - os: ubuntu-latest | |
| target: x86_64-unknown-linux-gnu | |
| - os: windows-11-arm | |
| target: aarch64-pc-windows-msvc | |
| extra_target: arm64ec-pc-windows-msvc | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| # The toolchain version and required components are defined in rust-toolchain.toml, | |
| # which rustup uses automatically when running cargo in this repository. | |
| - name: Install Rust toolchain from rust-toolchain.toml | |
| run: rustup show active-toolchain || rustup toolchain install | |
| # Install the prebuilt standard library for the matrix target. This is a no-op when the | |
| # target matches the host (e.g. x86_64 runners, or aarch64 on the windows-11-arm runner). | |
| - name: Add target | |
| run: rustup target add ${{ matrix.target }} | |
| - name: Run build script | |
| shell: pwsh | |
| run: .\build.ps1 -BuildLocked -Target ${{ matrix.target }} | |
| - name: Add extra target | |
| if: matrix.extra_target | |
| run: rustup target add ${{ matrix.extra_target }} | |
| - name: Run build script (extra target) | |
| if: matrix.extra_target | |
| shell: pwsh | |
| run: .\build.ps1 -BuildLocked -Target ${{ matrix.extra_target }} |