pixels/.github/workflows/ci.yml

146 lines
3.6 KiB
YAML
Raw Normal View History

2020-04-14 06:15:46 +10:00
name: CI
on:
push:
pull_request:
schedule:
- cron: '0 0 * * 0'
2020-04-14 06:15:46 +10:00
jobs:
checks:
name: Check
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
- beta
- 1.60.0
2020-04-14 06:15:46 +10:00
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Update apt repos
run: sudo apt-get -y update
2020-04-14 06:15:46 +10:00
- name: Install dependencies
run: sudo apt -y install libsdl2-dev
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
- name: Cargo check
uses: actions-rs/cargo@v1
with:
command: check
args: --all
lints:
name: Lints
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Update apt repos
run: sudo apt-get -y update
- name: Install dependencies
run: sudo apt -y install libsdl2-dev
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
components: clippy, rustfmt
override: true
- name: Cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: Cargo doc
uses: actions-rs/cargo@v1
with:
command: doc
args: --workspace --no-deps
- name: Cargo clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all --tests -- -D warnings
2020-04-14 06:15:46 +10:00
tests:
name: Test
runs-on: ubuntu-latest
needs: [checks, lints]
2020-04-14 06:15:46 +10:00
strategy:
matrix:
rust:
- stable
- beta
- 1.60.0
2020-04-14 06:15:46 +10:00
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Update apt repos
run: sudo apt-get -y update
2020-04-14 06:15:46 +10:00
- name: Install dependencies
run: sudo apt -y install libsdl2-dev
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
- name: Cargo test
uses: actions-rs/cargo@v1
with:
command: test
args: --all
wasm:
name: WASM
2020-04-14 06:15:46 +10:00
runs-on: ubuntu-latest
needs: [checks, lints]
strategy:
matrix:
example:
- minimal-web
2020-04-14 06:15:46 +10:00
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Update apt repos
run: sudo apt-get -y update
2020-04-14 06:15:46 +10:00
- name: Install dependencies
run: sudo apt -y install libsdl2-dev
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: wasm32-unknown-unknown
override: true
- name: Install tools
run: cargo install --locked wasm-bindgen-cli just
- name: Just build
run: just build ${{ matrix.example }}
# See https://github.com/parasyte/pixels-ci-rust-version
rust-version:
name: Rust-Version
runs-on: ubuntu-latest
needs: [checks, lints]
strategy:
matrix:
rust:
- 1.56.0
steps:
- name: Checkout sources
uses: actions/checkout@v3
with:
repository: parasyte/pixels-ci-rust-version
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
- name: Cargo build
uses: actions-rs/cargo@v1
with:
command: build