-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b757bd0
commit 62111ac
Showing
1 changed file
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
name: cicd | ||
|
||
on: | ||
push: | ||
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@v2 | ||
- 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@v1 | ||
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@v1 | ||
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@v1 | ||
with: | ||
path: target | ||
key: ${{ matrix.version }}-x86_64-unknown-linux-gnu-cargo-build-trimmed-${{ hashFiles('**/Cargo.lock') }} | ||
|
||
- name: Run default tests | ||
uses: actions-rs/cargo@v1 | ||
timeout-minutes: 40 | ||
with: | ||
command: test | ||
args: --all --features "actix cli chrono uuid" | ||
|
||
- name: Run tests | ||
timeout-minutes: 40 | ||
run: make test | ||
|
||
- 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 |