Merge pull request #252 from ryanfowler/dependabot/cargo/clap-4.5.29 #569
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: ci | |
on: | |
pull_request: | |
branches: ["main"] | |
push: | |
branches: ["main"] | |
env: | |
CROSS_VERSION: "0.2.5" | |
GO_VERSION: "1.23.4" | |
RUST_VERSION: "1.84.0" | |
jobs: | |
check: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
- name: Go format | |
run: gofmt -s -w . && git diff --exit-code | |
- name: Go tidy | |
run: go mod tidy && git diff --exit-code | |
- name: Go mod download | |
run: go mod download | |
- name: Go mod verify | |
run: go mod verify | |
- name: Go lint | |
uses: dominikh/staticcheck-action@v1.3.1 | |
with: | |
version: "2024.1.1" | |
install-go: false | |
- name: Set up Rust | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ env.RUST_VERSION }} | |
components: clippy, rustfmt | |
- name: Rust cargo format | |
run: cargo fmt --all -- --check | |
- name: Rust cargo clippy | |
run: cargo clippy -- -D warnings | |
- name: Rust cargo test | |
run: cargo test | |
- name: Run metafmt | |
run: cargo run --locked -- --diff --hidden | |
build: | |
runs-on: ${{ matrix.os }} | |
env: | |
CARGO: cargo | |
strategy: | |
matrix: | |
build: | |
- freebsd-x86_64 | |
- linux-arm64 | |
- linux-x86_64 | |
- macos-arm64 | |
- macos-x86_64 | |
include: | |
- build: freebsd-x86_64 | |
os: ubuntu-22.04 | |
target: x86_64-unknown-freebsd | |
- build: linux-arm64 | |
os: ubuntu-22.04 | |
target: aarch64-unknown-linux-gnu | |
- build: linux-x86_64 | |
os: ubuntu-22.04 | |
target: x86_64-unknown-linux-gnu | |
- build: macos-arm64 | |
os: macos-14 | |
target: aarch64-apple-darwin | |
- build: macos-x86_64 | |
os: macos-14 | |
target: x86_64-apple-darwin | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Go | |
if: ${{ matrix.os != 'ubuntu-22.04' }} | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
- name: Set up Rust | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ env.RUST_VERSION }} | |
target: ${{ matrix.target }} | |
- name: Install cross | |
if: ${{ matrix.os == 'ubuntu-22.04' }} | |
run: | | |
./ci/install-cross.sh | |
echo "CARGO=cross" >> $GITHUB_ENV | |
- name: Rust cargo build | |
run: ${{ env.CARGO }} build --locked --target ${{ matrix.target }} |