Skip to content

Build and Test

Build and Test #1663

Workflow file for this run

name: Build and Test
on:
push:
branches:
- master
pull_request:
schedule:
- cron: "0 7 * * *"
jobs:
build_and_test:
strategy:
fail-fast: false
matrix:
version:
- stable
- nightly
name: ${{ matrix.version }} - x86_64-unknown-linux-gnu
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install ${{ matrix.version }}
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.version }}-x86_64-unknown-linux-gnu
profile: minimal
override: true
- name: Generate Cargo.lock
uses: actions-rs/cargo@v1
with:
command: generate-lockfile
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: ~/.cargo/registry
key: ${{ matrix.version }}-x86_64-unknown-linux-gnu-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v4
with:
path: ~/.cargo/git
key: ${{ matrix.version }}-x86_64-unknown-linux-gnu-cargo-index-trimmed-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@v4
with:
path: target
key: ${{ matrix.version }}-x86_64-unknown-linux-gnu-cargo-build-trimmed-${{ hashFiles('**/Cargo.lock') }}
- name: Init submodule
run: |
git submodule update --init --recursive
- name: Build actix features
uses: actions-rs/cargo@v1
timeout-minutes: 10
with:
command: build
args: --all --features "actix4 cli chrono url uuid swagger-ui rapidoc v3 actix4-validator"
- name: Build actix3 features
uses: actions-rs/cargo@v1
timeout-minutes: 10
with:
command: build
args: --all --features "actix3 cli chrono url uuid swagger-ui rapidoc v3 actix3-validator"
# - name: Build actix2 features
# uses: actions-rs/cargo@v1
# timeout-minutes: 10
# with:
# command: build
# args: --all --features "actix2 cli chrono url uuid swagger-ui rapidoc v3"
- name: Run actix tests
uses: actions-rs/cargo@v1
timeout-minutes: 20
with:
command: test
args: --all --features "actix4 cli chrono url uuid swagger-ui rapidoc v3 actix4-validator"
- name: Run actix3 tests
uses: actions-rs/cargo@v1
timeout-minutes: 20
with:
command: test
args: --all --features "actix3 cli chrono url uuid swagger-ui rapidoc v3 actix3-validator"
# - name: Run actix2 tests
# uses: actions-rs/cargo@v1
# timeout-minutes: 20
# with:
# command: test
# args: --all --features "actix2 cli chrono url uuid swagger-ui rapidoc v3"
- name: Install cargo-cache
continue-on-error: true
run: |
cargo install cargo-cache --no-default-features --features ci-autoclean
- name: Run the cargo cache
run: |
cargo-cache