youmubot/.github/workflows/build_test.yml
Natsu Kagami 51fa34a7bf
osu: Some lazer-related stat reconsideration (#56)
* Split lazer property to its own toggle

* Use lazer stats from API more verbatim in pp calculation

* Update CI to use 1.83

* Set rust-toolchain
2024-12-21 23:05:15 +00:00

81 lines
2.5 KiB
YAML

name: Build and Test
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
CARGO_TERM_COLOR: always
jobs:
format_check:
name: Format check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: dtolnay/rust-toolchain@1.83.0
with:
components: rustfmt
- name: Run rustfmt
run: cargo fmt -- --check
check:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: dtolnay/rust-toolchain@1.83.0
id: cargo
with:
components: clippy
- uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-rust-${{ steps.cargo.outputs.cachekey }}-${{ hashFiles('**/Cargo.lock') }}-lint
- name: Run cargo check
run: cargo check
env:
SQLX_OFFLINE: "true"
- name: Run clippy
run: cargo clippy
env:
SQLX_OFFLINE: "true"
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.83.0
id: cargo
with:
components: clippy
- uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-rust-${{ steps.cargo.outputs.cachekey }}-${{ hashFiles('**/Cargo.lock') }}-debug-build
- name: Run cargo test
run: cargo test
env:
SQLX_OFFLINE: "true"
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: cachix/install-nix-action@v27
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- uses: cachix/cachix-action@v15
with:
name: natsukagami
# If you chose API tokens for write access OR if you have a private cache
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: Run nix build
run: nix build