82 lines
2.1 KiB
YAML
82 lines
2.1 KiB
YAML
name: checks
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
network-tests:
|
|
type: boolean
|
|
default: false
|
|
ref:
|
|
type: string
|
|
default: ""
|
|
secrets:
|
|
curseforge-api-key:
|
|
required: false
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
RUST_BACKTRACE: 1
|
|
|
|
jobs:
|
|
format:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
ref: ${{ inputs.ref || github.sha }}
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
components: rustfmt
|
|
- run: cargo fmt --all -- --check
|
|
|
|
build-and-test:
|
|
name: build and test (${{ matrix.os }})
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
ref: ${{ inputs.ref || github.sha }}
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
components: clippy
|
|
- uses: actions/setup-java@v5
|
|
with:
|
|
distribution: temurin
|
|
java-version: "21"
|
|
- uses: Swatinem/rust-cache@v2
|
|
with:
|
|
key: ${{ matrix.os }}
|
|
- name: install Linux build dependencies
|
|
if: runner.os == 'Linux'
|
|
run: sudo apt-get update && sudo apt-get install --yes libxcb1-dev
|
|
- run: cargo build --locked
|
|
- run: cargo clippy --all-targets --locked -- -D warnings
|
|
- run: cargo test --locked --all-targets
|
|
|
|
network-tests:
|
|
if: inputs.network-tests
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
CURSEFORGE_API_KEY: ${{ secrets.curseforge-api-key }}
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
ref: ${{ inputs.ref || github.sha }}
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
- uses: actions/setup-java@v5
|
|
with:
|
|
distribution: temurin
|
|
java-version: "21"
|
|
- uses: Swatinem/rust-cache@v2
|
|
- name: install Linux build dependencies
|
|
run: sudo apt-get update && sudo apt-get install --yes libxcb1-dev
|
|
- run: cargo test --locked --all-targets -- --ignored
|