mirror of
https://github.com/actix/examples
synced 2024-11-27 16:02:57 +01:00
refactor CI
This commit is contained in:
parent
8a24fb9264
commit
7caab85d01
40
.github/workflows/clippy-fmt.yml
vendored
40
.github/workflows/clippy-fmt.yml
vendored
@ -10,46 +10,28 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- uses: actions-rs/toolchain@v1
|
- uses: dtolnay/rust-toolchain@stable
|
||||||
with:
|
with: { components: rustfmt }
|
||||||
profile: minimal
|
|
||||||
toolchain: stable
|
|
||||||
components: rustfmt
|
|
||||||
override: true
|
|
||||||
|
|
||||||
- name: rustfmt
|
- name: rustfmt
|
||||||
uses: actions-rs/cargo@v1
|
run: cargo fmt --all -- --check
|
||||||
with:
|
|
||||||
command: fmt
|
|
||||||
args: --all -- --check
|
|
||||||
|
|
||||||
clippy:
|
clippy:
|
||||||
name: clippy check
|
name: clippy check
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: cache cargo artifacts
|
- uses: dtolnay/rust-toolchain@stable
|
||||||
uses: actions/cache@v2
|
with: { components: clippy }
|
||||||
with:
|
|
||||||
path: |
|
- run: cargo generate-lockfile
|
||||||
~/.cargo/registry
|
- name: Cache Dependencies
|
||||||
~/.cargo/git
|
uses: Swatinem/rust-cache@v2.2.0
|
||||||
./target/debug
|
|
||||||
key: cargo-clippy-${{ matrix.version }}-${{ hashFiles('**/Cargo.lock') }}
|
|
||||||
restore-keys: |
|
|
||||||
cargo-clippy-${{ matrix.version }}-
|
|
||||||
|
|
||||||
- uses: actions-rs/toolchain@v1
|
|
||||||
with:
|
|
||||||
profile: minimal
|
|
||||||
toolchain: stable
|
|
||||||
components: clippy
|
|
||||||
override: true
|
|
||||||
|
|
||||||
# - name: Create test DBs
|
# - name: Create test DBs
|
||||||
# run: |
|
# run: |
|
||||||
# sudo apt-get update && sudo apt-get install sqlite3
|
# sudo apt-get update && sudo apt-get install sqlite3
|
||||||
|
34
.github/workflows/linux.yml
vendored
34
.github/workflows/linux.yml
vendored
@ -4,8 +4,7 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
types: [opened, synchronize, reopened]
|
types: [opened, synchronize, reopened]
|
||||||
push:
|
push:
|
||||||
branches:
|
branches: [master]
|
||||||
- master
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build_and_test:
|
build_and_test:
|
||||||
@ -13,28 +12,25 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
version: [stable, nightly]
|
version: [stable, nightly]
|
||||||
|
|
||||||
name: ${{ matrix.version }}
|
name: ${{ matrix.version }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
env:
|
env:
|
||||||
CI: '1'
|
CI: 1
|
||||||
CARGO_UNSTABLE_SPARSE_REGISTRY: 'true'
|
CARGO_UNSTABLE_SPARSE_REGISTRY: true
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- uses: actions-rs/toolchain@v1
|
- name: Install Rust
|
||||||
with:
|
run: |
|
||||||
profile: minimal
|
rustup install ${{ matrix.version }} --no-self-update --profile minimal --force
|
||||||
toolchain: ${{ matrix.version }}
|
rustup override set ${{ matrix.version }}
|
||||||
override: true
|
|
||||||
|
|
||||||
- name: Generate Cargo.lock
|
- run: cargo generate-lockfile
|
||||||
uses: actions-rs/cargo@v1
|
|
||||||
with: { command: generate-lockfile }
|
|
||||||
- name: Cache Dependencies
|
- name: Cache Dependencies
|
||||||
uses: Swatinem/rust-cache@v1.2.0
|
uses: Swatinem/rust-cache@v2.2.0
|
||||||
|
|
||||||
- name: Create test DBs
|
- name: Create test DBs
|
||||||
run: |
|
run: |
|
||||||
@ -54,8 +50,7 @@ jobs:
|
|||||||
|
|
||||||
- name: start redis
|
- name: start redis
|
||||||
uses: supercharge/redis-github-action@1.1.0
|
uses: supercharge/redis-github-action@1.1.0
|
||||||
with:
|
with: { redis-version: 6 }
|
||||||
redis-version: 6
|
|
||||||
|
|
||||||
# - name: run diesel migrations
|
# - name: run diesel migrations
|
||||||
# run: |
|
# run: |
|
||||||
@ -65,8 +60,5 @@ jobs:
|
|||||||
# chmod a+rwx test.db
|
# chmod a+rwx test.db
|
||||||
|
|
||||||
- name: cargo test
|
- name: cargo test
|
||||||
uses: actions-rs/cargo@v1
|
run: cargo test --workspace --all-features --no-fail-fast -- --nocapture
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
with:
|
|
||||||
command: test
|
|
||||||
args: --workspace --all-features --no-fail-fast -- --nocapture
|
|
||||||
|
Loading…
Reference in New Issue
Block a user