forked from mirror/Riven
1
0
Fork 0
Riven/.github/workflows/ci.yml

121 lines
3.1 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
uses: fkirc/skip-duplicate-actions@v3.4.0
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
uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
- 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
2022-08-15 23:01:07 +00:00
- name: Run `cargo +stable check --all-targets`
2022-08-15 22:37:25 +00:00
uses: actions-rs/cargo@v1
with:
2022-08-15 23:01:07 +00:00
toolchain: stable
2022-08-15 22:37:25 +00:00
command: check
args: --all-targets
2022-08-15 23:01:07 +00:00
- name: Run `cargo +stable check --all-targets --features tracing`
uses: actions-rs/cargo@v1
with:
toolchain: stable
command: check
args: --all-targets --features tracing
- name: Run `cargo check --all-targets --features nightly,tracing`
uses: actions-rs/cargo@v1
with:
command: check
args: --all-targets --features nightly,tracing
- name: Run `cargo build --all-targets --features nightly,deny-unknown`
uses: actions-rs/cargo@v1
with:
command: build
args: --all-targets --features nightly,deny-unknown
- name: Run `cargo test --features nightly,deny-unknown`
2022-08-15 22:37:25 +00:00
uses: actions-rs/cargo@v1
with:
command: test
2022-08-15 23:01:07 +00:00
args: --features nightly,deny-unknown
env:
RUST_BACKTRACE: 1
RUSTLOG: riven=trace
RGAPI_KEY: ${{ secrets.RGAPI_KEY }}
2022-08-15 22:37:25 +00:00
# lints:
# name: Lints
# needs: pre_job
# if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
# runs-on: ubuntu-latest
# steps:
# - name: Checkout sources
# uses: actions/checkout@v2
# - 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