mirror of
https://github.com/actix/examples
synced 2024-11-30 17:14:35 +01:00
73 lines
1.8 KiB
YAML
73 lines
1.8 KiB
YAML
name: CI (Linux)
|
|
|
|
on:
|
|
pull_request:
|
|
types: [opened, synchronize, reopened]
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
build_and_test:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
version: [stable, nightly]
|
|
|
|
name: ${{ matrix.version }}
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
CI: '1'
|
|
CARGO_UNSTABLE_SPARSE_REGISTRY: 'true'
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
profile: minimal
|
|
toolchain: ${{ matrix.version }}
|
|
override: true
|
|
|
|
- name: Generate Cargo.lock
|
|
uses: actions-rs/cargo@v1
|
|
with: { command: generate-lockfile }
|
|
- name: Cache Dependencies
|
|
uses: Swatinem/rust-cache@v1.2.0
|
|
|
|
- name: Create test DBs
|
|
run: |
|
|
sudo apt-get update && sudo apt-get install sqlite3
|
|
cargo install sqlx-cli --no-default-features --features=rustls,sqlite
|
|
cd basics/todo
|
|
DATABASE_URL="sqlite://./todo.db" sqlx database create
|
|
chmod a+rwx todo.db
|
|
DATABASE_URL="sqlite://./todo.db" sqlx migrate run
|
|
|
|
- name: cargo check
|
|
uses: actions-rs/cargo@v1
|
|
timeout-minutes: 30
|
|
with:
|
|
command: check
|
|
args: --workspace --bins --examples --tests
|
|
|
|
- name: start redis
|
|
uses: supercharge/redis-github-action@1.1.0
|
|
with:
|
|
redis-version: 6
|
|
|
|
# - name: run diesel migrations
|
|
# run: |
|
|
# cargo install diesel_cli --no-default-features --features sqlite
|
|
# cd databases/diesel
|
|
# diesel migration run
|
|
# chmod a+rwx test.db
|
|
|
|
- name: cargo test
|
|
uses: actions-rs/cargo@v1
|
|
timeout-minutes: 30
|
|
with:
|
|
command: test
|
|
args: --workspace --all-features --no-fail-fast -- --nocapture
|