forked from dani-garcia/vaultwarden
-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (50 loc) · 1.83 KB
/
rust-linux.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: build-linux
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
db-backend: [sqlite, mysql, postgresql]
steps:
- uses: actions/checkout@v1
- name: Install dependencies
run: sudo apt update && sudo apt install --no-install-recommends openssl sqlite3 libmysql++-dev libpq-dev
- name: Cache cargo registry
uses: actions/[email protected]
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/[email protected]
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
uses: actions/[email protected]
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
- name: Install latest nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
profile: minimal
target: x86_64-unknown-linux-gnu
- name: Build
run: cargo build --verbose --features ${{ matrix.db-backend }} --release --target x86_64-unknown-linux-gnu
- name: Run tests
run: cargo test --features ${{ matrix.db-backend }}
- name: Upload linux artifact
uses: actions/[email protected]
with:
name: x86_64-unknown-linux-gnu-${{ matrix.db-backend }}-bitwarden_rs
path: target/x86_64-unknown-linux-gnu/release/bitwarden_rs
- name: Release
uses: Shopify/[email protected]
if: startsWith(github.ref, 'refs/tags/')
with:
name: x86_64-unknown-linux-gnu-${{ matrix.db-backend }}-bitwarden_rs
path: target/x86_64-apple-darwin/release/bitwarden_rs
repo-token: ${{ secrets.GITHUB_TOKEN }}