Riven/.github/workflows/ci.yml

124 lines
3 KiB
YAML
Raw Normal View History

2022-08-15 22:37:25 +00:00
name: CI
on:
push:
branches: [v/2.x.x]
pull_request:
branches: [v/2.x.x]
schedule:
- cron: "24 05 * * *" # Daily at 10:24 PM PDT, 9:24 PM PST.
workflow_dispatch:
# TODO: generate nightly releases
# inputs:
# should_bench:
# description: "Should Benchmark? (`true`)"
# required: true
# default: "false"
jobs:
pre_job:
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
2024-06-12 15:14:26 +00:00
uses: fkirc/skip-duplicate-actions@v5.3.1
2022-08-15 22:37:25 +00:00
with:
cancel_others: "true"
test:
name: Check & Test
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout sources
2024-06-12 15:14:26 +00:00
uses: actions/checkout@v4
2022-08-15 22:37:25 +00:00
- name: Setup Node
2024-06-12 15:14:26 +00:00
uses: actions/setup-node@v4
2022-08-15 22:37:25 +00:00
with:
2024-06-12 15:14:26 +00:00
node-version: 20
2022-08-15 22:37:25 +00:00
- name: Install Node dependencies
run: npm ci --prefix riven/srcgen
- name: Run codegen
run: node riven/srcgen
- name: Install Rust nightly toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
components: rustfmt
- uses: actions-rs/cargo@v1
2022-08-15 22:37:25 +00:00
with:
2022-08-15 23:01:07 +00:00
toolchain: stable
2022-08-15 22:37:25 +00:00
command: check
args: --all-targets --features __proxy
2022-08-15 22:37:25 +00:00
- uses: actions-rs/cargo@v1
2022-08-15 23:01:07 +00:00
with:
toolchain: stable
command: check
args: --all-targets --features tracing,__proxy
2022-08-15 23:01:07 +00:00
- uses: actions-rs/cargo@v1
2022-08-15 23:01:07 +00:00
with:
command: check
args: --all-targets --features nightly,tracing,__proxy
2022-08-15 23:01:07 +00:00
- uses: actions-rs/cargo@v1
2022-08-15 23:01:07 +00:00
with:
command: build
args: --all-targets --features nightly,deny-unknown,__proxy
2022-08-15 23:01:07 +00:00
- uses: actions-rs/cargo@v1
2022-08-15 22:37:25 +00:00
with:
command: test
args: --no-fail-fast --features nightly,deny-unknown,__proxy
2022-08-15 23:01:07 +00:00
env:
RUST_BACKTRACE: 1
RUSTLOG: riven=trace
RGAPI_KEY: ${{ secrets.RGAPI_KEY }}
2022-08-15 22:37:25 +00:00
- name: Install `wasm-pack`
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- working-directory: riven
run: wasm-pack test --node -- --features nightly,deny-unknown
env:
RGAPI_KEY: ${{ secrets.RGAPI_KEY }}
2023-05-10 18:27:57 +00:00
lints:
name: Lints
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout sources
2024-06-12 15:14:26 +00:00
uses: actions/checkout@v4
2023-05-10 18:27:57 +00:00
- name: Install nightly toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
components: rustfmt, clippy
- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings