name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions: read-all
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- uses: dtolnay/rust-toolchain@6d9817901c499d6b02debbb57edb38d33daa680b with:
toolchain: stable
components: clippy, rustfmt
- uses: Swatinem/rust-cache@ad397744b0d591a723ab90405b7247fac0e6b8db
- name: Check formatting
run: cargo fmt --check
- name: Clippy
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Build
run: cargo build --release
- name: Test
run: cargo test
release:
needs: build
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- uses: dtolnay/rust-toolchain@6d9817901c499d6b02debbb57edb38d33daa680b
- uses: Swatinem/rust-cache@ad397744b0d591a723ab90405b7247fac0e6b8db
- name: Build release binary
run: cargo build --release
- name: Upload artifact
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 with:
name: rescript-openapi-linux-x64
path: target/release/rescript-openapi