Skip to content

Commit

Permalink
update github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
hails committed Mar 21, 2020
1 parent 5fcdc6b commit fb909d9
Showing 1 changed file with 35 additions and 8 deletions.
43 changes: 35 additions & 8 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,46 @@
name: Rust

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
branches:
- master
push:
branches:
- master

jobs:
build:
rust:
name: Rust project

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose

- name: Install OS deps
run: sudo apt update -y && sudo apt install -y libpq-dev

- name: Install Rust stable
run: rustup update stable && rustup default stable

- name: Cache cargo registry
uses: actions/cache@v1
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v1
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@v1
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}

- name: Run rustfmt
run: cargo fmt --all -- --check

- name: Run the test suite
run: cargo test --all

0 comments on commit fb909d9

Please sign in to comment.