[StepSecurity] Apply security best practices #48
Workflow file for this run
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: | |
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 | |
runs-on: ${{ matrix.os }} | |
env: | |
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse | |
steps: | |
- name: Checkout | |
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 | |
# no_global_oom_handling is currently broken in 1.69: https://github.com/rust-lang/rust/pull/110649 | |
# So use 1.68 until it gets fixed. | |
- name: Update Rust toolchain | |
run: rustup install 1.68 | |
- name: Set 1.68 as the default | |
run: rustup default 1.68 | |
- name: Add required components | |
run: rustup component add rust-src clippy rustfmt rust-docs --toolchain 1.68-${{ matrix.target }} | |
- name: Run build script | |
shell: pwsh | |
run: .\build.ps1 -BuildLocked |