Skip to content

Commit

Permalink
ci: added github-actions
Browse files Browse the repository at this point in the history
  • Loading branch information
ansrivas authored and tiagolobocastro committed Sep 29, 2021
1 parent b757bd0 commit 62111ac
Showing 1 changed file with 71 additions and 0 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/cicd.yml
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

0 comments on commit 62111ac

Please sign in to comment.