2021-03-22 12:46:02 +01:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
types: [opened, synchronize, reopened]
|
|
|
|
push:
|
|
|
|
branches: [master]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build_and_test_linux:
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
target:
|
|
|
|
- { name: Linux, os: ubuntu-latest, triple: x86_64-unknown-linux-gnu }
|
|
|
|
version:
|
2023-03-23 11:53:54 +01:00
|
|
|
- '1.60' # MSRV
|
2021-03-22 12:46:02 +01:00
|
|
|
- stable
|
|
|
|
|
|
|
|
name: ${{ matrix.target.name }} / ${{ matrix.version }}
|
|
|
|
runs-on: ${{ matrix.target.os }}
|
|
|
|
|
|
|
|
services:
|
|
|
|
redis:
|
2022-03-06 00:22:14 +01:00
|
|
|
image: redis:6
|
2021-03-22 12:46:02 +01:00
|
|
|
ports:
|
|
|
|
- 6379:6379
|
2022-03-06 00:22:14 +01:00
|
|
|
options: >-
|
|
|
|
--health-cmd "redis-cli ping"
|
|
|
|
--health-interval 10s
|
|
|
|
--health-timeout 5s
|
|
|
|
--health-retries 5
|
|
|
|
--entrypoint redis-server
|
2021-03-22 12:46:02 +01:00
|
|
|
|
|
|
|
steps:
|
2022-05-25 15:07:31 +02:00
|
|
|
- uses: actions/checkout@v3
|
2021-03-22 12:46:02 +01:00
|
|
|
|
|
|
|
- name: Install ${{ matrix.version }}
|
2022-12-01 11:45:31 +01:00
|
|
|
run: |
|
|
|
|
rustup install ${{ matrix.version }}-${{ matrix.target.triple }}
|
|
|
|
rustup override set ${{ matrix.version }}-${{ matrix.target.triple }}
|
2021-03-22 12:46:02 +01:00
|
|
|
|
2022-07-04 17:43:33 +02:00
|
|
|
- name: Install cargo-hack
|
|
|
|
uses: taiki-e/install-action@cargo-hack
|
|
|
|
|
2023-01-07 02:57:03 +01:00
|
|
|
- name: workaround MSRV issues
|
|
|
|
if: matrix.version != 'stable'
|
|
|
|
run: |
|
|
|
|
cargo install cargo-edit --version=0.8.0
|
|
|
|
cargo add env_logger@0.9 --dev -p=actix-cors
|
|
|
|
cargo add env_logger@0.9 --dev -p=actix-identity
|
|
|
|
cargo add env_logger@0.9 --dev -p=actix-redis
|
|
|
|
cargo add env_logger@0.9 --dev -p=actix-session
|
|
|
|
cargo add env_logger@0.9 --dev -p=actix-settings
|
|
|
|
|
2021-03-22 12:46:02 +01:00
|
|
|
- name: Generate Cargo.lock
|
2022-12-01 11:45:31 +01:00
|
|
|
run: cargo generate-lockfile
|
2021-03-22 12:46:02 +01:00
|
|
|
- name: Cache Dependencies
|
2022-12-01 11:45:31 +01:00
|
|
|
uses: Swatinem/rust-cache@v2.1.0
|
2021-03-22 12:46:02 +01:00
|
|
|
|
|
|
|
- name: check minimal
|
2022-12-01 11:45:31 +01:00
|
|
|
run: cargo ci-min
|
2021-06-27 08:02:38 +02:00
|
|
|
|
2022-05-25 15:07:31 +02:00
|
|
|
- name: check minimal + examples
|
2022-12-01 11:45:31 +01:00
|
|
|
run: cargo ci-check-min-examples
|
2021-06-27 08:02:38 +02:00
|
|
|
|
|
|
|
- name: check default
|
2022-12-01 11:45:31 +01:00
|
|
|
run: cargo ci-check
|
2021-03-22 12:46:02 +01:00
|
|
|
|
|
|
|
- name: tests
|
2021-06-27 08:02:38 +02:00
|
|
|
timeout-minutes: 40
|
2022-12-01 11:45:31 +01:00
|
|
|
run: cargo ci-test
|
2021-06-27 08:02:38 +02:00
|
|
|
|
2021-03-22 12:46:02 +01:00
|
|
|
- name: Clear the cargo caches
|
|
|
|
run: |
|
2021-06-27 08:02:38 +02:00
|
|
|
cargo install cargo-cache --version 0.6.2 --no-default-features --features ci-autoclean
|
2021-03-22 12:46:02 +01:00
|
|
|
cargo-cache
|
|
|
|
|
|
|
|
build_and_test_other:
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
target:
|
|
|
|
- { name: macOS, os: macos-latest, triple: x86_64-apple-darwin }
|
2022-12-01 11:45:31 +01:00
|
|
|
- {
|
|
|
|
name: Windows,
|
|
|
|
os: windows-latest,
|
|
|
|
triple: x86_64-pc-windows-msvc,
|
|
|
|
}
|
2021-03-22 12:46:02 +01:00
|
|
|
version:
|
2023-03-23 11:53:54 +01:00
|
|
|
- '1.60' # MSRV
|
2021-03-22 12:46:02 +01:00
|
|
|
- stable
|
|
|
|
|
|
|
|
name: ${{ matrix.target.name }} / ${{ matrix.version }}
|
|
|
|
runs-on: ${{ matrix.target.os }}
|
|
|
|
|
|
|
|
steps:
|
2022-05-25 15:07:31 +02:00
|
|
|
- uses: actions/checkout@v3
|
2021-03-22 12:46:02 +01:00
|
|
|
|
|
|
|
- name: Install ${{ matrix.version }}
|
2022-12-01 11:45:31 +01:00
|
|
|
run: |
|
|
|
|
rustup install ${{ matrix.version }}-${{ matrix.target.triple }}
|
|
|
|
rustup override set ${{ matrix.version }}-${{ matrix.target.triple }}
|
2021-03-22 12:46:02 +01:00
|
|
|
|
2022-07-04 17:43:33 +02:00
|
|
|
- name: Install cargo-hack
|
|
|
|
uses: taiki-e/install-action@cargo-hack
|
|
|
|
|
2023-01-07 02:38:07 +01:00
|
|
|
- name: workaround MSRV issues
|
|
|
|
if: matrix.version != 'stable'
|
|
|
|
run: |
|
|
|
|
cargo install cargo-edit --version=0.8.0
|
|
|
|
cargo add env_logger@0.9 --dev -p=actix-cors
|
|
|
|
cargo add env_logger@0.9 --dev -p=actix-identity
|
|
|
|
cargo add env_logger@0.9 --dev -p=actix-redis
|
|
|
|
cargo add env_logger@0.9 --dev -p=actix-session
|
|
|
|
cargo add env_logger@0.9 --dev -p=actix-settings
|
|
|
|
|
2021-03-22 12:46:02 +01:00
|
|
|
- name: Generate Cargo.lock
|
2022-12-01 11:45:31 +01:00
|
|
|
run: cargo generate-lockfile
|
2021-03-22 12:46:02 +01:00
|
|
|
- name: Cache Dependencies
|
2022-12-01 11:45:31 +01:00
|
|
|
uses: Swatinem/rust-cache@v2.1.0
|
2021-03-22 12:46:02 +01:00
|
|
|
|
|
|
|
- name: check minimal
|
2022-12-01 11:45:31 +01:00
|
|
|
run: cargo ci-min
|
2021-06-27 08:02:38 +02:00
|
|
|
|
2022-05-25 15:07:31 +02:00
|
|
|
- name: check minimal + examples
|
2022-12-01 11:45:31 +01:00
|
|
|
run: cargo ci-check-min-examples
|
2021-06-27 08:02:38 +02:00
|
|
|
|
|
|
|
- name: check default
|
2022-12-01 11:45:31 +01:00
|
|
|
run: cargo ci-check
|
2021-03-22 12:46:02 +01:00
|
|
|
|
|
|
|
- name: tests
|
2021-06-27 08:02:38 +02:00
|
|
|
timeout-minutes: 40
|
2022-12-01 11:45:31 +01:00
|
|
|
run: cargo ci-test --exclude=actix-redis --exclude=actix-session --exclude=actix-limitation
|
2021-03-22 12:46:02 +01:00
|
|
|
|
|
|
|
- name: Clear the cargo caches
|
|
|
|
run: |
|
2021-06-27 08:02:38 +02:00
|
|
|
cargo install cargo-cache --version 0.6.2 --no-default-features --features ci-autoclean
|
2021-03-22 12:46:02 +01:00
|
|
|
cargo-cache
|
2021-11-23 00:42:47 +01:00
|
|
|
|
|
|
|
doc_tests:
|
|
|
|
name: doc tests
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-05-25 15:07:31 +02:00
|
|
|
- uses: actions/checkout@v3
|
2021-11-23 00:42:47 +01:00
|
|
|
|
|
|
|
- name: Install Rust (nightly)
|
2022-12-01 11:45:31 +01:00
|
|
|
run: |
|
|
|
|
rustup install nightly
|
|
|
|
rustup override set nightly
|
2021-11-23 00:42:47 +01:00
|
|
|
|
|
|
|
- name: Generate Cargo.lock
|
2022-12-01 11:45:31 +01:00
|
|
|
run: cargo generate-lockfile
|
2021-11-23 00:42:47 +01:00
|
|
|
- name: Cache Dependencies
|
2022-12-01 11:45:31 +01:00
|
|
|
uses: Swatinem/rust-cache@v2.1.0
|
2021-11-23 00:42:47 +01:00
|
|
|
|
|
|
|
- name: doc tests
|
|
|
|
timeout-minutes: 40
|
2022-12-01 11:45:31 +01:00
|
|
|
run: cargo ci-doctest -- --nocapture
|