ci: basic setup #932
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: | |
push: | |
branches: ["*.*.x"] | |
pull_request: | |
branches: ["*.*.x"] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
check-format: | |
name: Check formatting | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: rustup toolchain install nightly --profile minimal --component rustfmt --no-self-update | |
- run: cargo +nightly fmt --all -- --check | |
lint: | |
name: Lint | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: rustup toolchain install stable --profile minimal --component clippy --no-self-update | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
shared-key: "debug" | |
cache-on-failure: true | |
- run: cargo clippy --all-features -- -D warnings | |
test: | |
name: Test | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: rustup toolchain install stable --profile minimal --no-self-update | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
shared-key: "debug" | |
cache-on-failure: true | |
- run: cargo test --all-features | |
build: | |
name: Build | |
runs-on: windows-latest | |
env: | |
ARCHIVE_NAME: redscript-${{ github.ref_name }}.zip | |
steps: | |
- uses: actions/checkout@v4 | |
- run: rustup toolchain install stable --profile minimal --no-self-update | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
shared-key: "release" | |
- run: cargo build --release | |
- run: .\build\package.ps1 -zipPath ${{ env.ARCHIVE_NAME }} | |
- uses: actions/upload-artifact@v4 | |
with: | |
path: | | |
${{ env.ARCHIVE_NAME }} | |
target/release/redscript-cli.exe | |
if-no-files-found: error |