2021-12-20 11:48:29 -05:00
|
|
|
name: ci
|
|
|
|
|
|
|
|
on: push
|
|
|
|
|
|
|
|
env:
|
|
|
|
CARGO_TERM_COLOR: always
|
2023-04-17 08:16:39 -04:00
|
|
|
RUSTFLAGS: "-Dwarnings"
|
2021-12-20 11:48:29 -05:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
2022-01-11 05:43:06 -05:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- cargo_target: "x86_64-unknown-linux-gnu"
|
|
|
|
- cargo_target: "wasm32-unknown-unknown"
|
2021-12-20 11:48:29 -05:00
|
|
|
steps:
|
|
|
|
- name: Clone repo
|
2023-04-17 08:16:39 -04:00
|
|
|
uses: actions/checkout@v3
|
2022-01-11 05:43:06 -05:00
|
|
|
- name: Add targets
|
|
|
|
run: rustup target add wasm32-unknown-unknown
|
2023-04-17 08:16:39 -04:00
|
|
|
- uses: Swatinem/rust-cache@v2
|
|
|
|
- name: Docker Compose
|
|
|
|
run: docker-compose -f test/docker-compose.yml up -d redis
|
|
|
|
|
2021-12-20 11:48:29 -05:00
|
|
|
- name: Build
|
2022-01-11 05:43:06 -05:00
|
|
|
env:
|
|
|
|
CARGO_BUILD_TARGET: ${{ matrix.cargo_target }}
|
2023-04-17 08:16:39 -04:00
|
|
|
run: cargo build
|
2021-12-20 11:48:29 -05:00
|
|
|
- name: Clippy
|
2022-01-11 05:43:06 -05:00
|
|
|
env:
|
|
|
|
CARGO_BUILD_TARGET: ${{ matrix.cargo_target }}
|
2023-04-17 08:16:39 -04:00
|
|
|
run: cargo clippy
|
2021-12-20 11:48:29 -05:00
|
|
|
- name: Fmt
|
2022-01-11 05:43:06 -05:00
|
|
|
env:
|
|
|
|
CARGO_BUILD_TARGET: ${{ matrix.cargo_target }}
|
2021-12-20 11:48:29 -05:00
|
|
|
run: cargo fmt -- --check
|
2023-04-17 08:16:39 -04:00
|
|
|
|
|
|
|
- name: Test
|
|
|
|
if: matrix.cargo_target == 'x86_64-unknown-linux-gnu'
|
|
|
|
run: cargo test
|