vaultwarden/.github/workflows/rust-win.yml

71 lines
2 KiB
YAML
Raw Normal View History

2019-12-22 08:50:05 +01:00
name: build-windows
2019-12-25 00:20:00 +01:00
on: [push, pull_request]
2019-12-22 08:50:05 +01:00
jobs:
build:
runs-on: windows-latest
2019-12-25 00:20:00 +01:00
strategy:
matrix:
db-backend: [sqlite, mysql, postgresql]
2019-12-22 08:50:05 +01:00
steps:
- uses: actions/checkout@v1
2019-12-25 02:50:57 +01:00
- name: Cache choco cache
uses: actions/cache@v1.0.3
with:
path: ~\AppData\Local\Temp\chocolatey
key: ${{ runner.os }}-choco-cache
2019-12-25 00:20:00 +01:00
- name: Install dependencies
2019-12-25 01:59:07 +01:00
run: choco install openssl sqlite postgresql12 mysql
2019-12-25 00:20:00 +01:00
- name: Cache cargo registry
uses: actions/cache@v1.0.3
2019-12-22 08:50:05 +01:00
with:
2019-12-25 00:20:00 +01:00
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v1.0.3
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
2019-12-22 08:50:05 +01:00
uses: actions/cache@v1.0.3
with:
path: target
2019-12-25 00:20:00 +01:00
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
2019-12-25 02:50:57 +01:00
target: x86_64-pc-windows-msvc
2019-12-25 00:20:00 +01:00
2019-12-22 08:50:05 +01:00
- name: Build
2019-12-25 02:50:57 +01:00
run: cargo.exe build --verbose --features ${{ matrix.db-backend }} --release --target x86_64-pc-windows-msvc
env:
OPENSSL_DIR: C:\Program Files\OpenSSL-Win64\
2019-12-25 00:20:00 +01:00
- name: Run tests
run: cargo test --features ${{ matrix.db-backend }}
2019-12-22 08:50:05 +01:00
- name: Upload windows artifact
uses: actions/upload-artifact@v1.0.0
with:
2019-12-25 02:50:57 +01:00
name: x86_64-pc-windows-msvc-${{ matrix.db-backend }}-bitwarden_rs
2019-12-25 00:20:00 +01:00
path: target/release/bitwarden_rs.exe
- name: Release
2019-12-25 00:25:35 +01:00
uses: Shopify/upload-to-release@1.0.0
2019-12-25 00:20:00 +01:00
if: startsWith(github.ref, 'refs/tags/')
with:
2019-12-25 02:50:57 +01:00
name: x86_64-pc-windows-msvc-${{ matrix.db-backend }}-bitwarden_rs
2019-12-22 08:50:05 +01:00
path: target/release/bitwarden_rs.exe
2019-12-25 00:20:00 +01:00
repo-token: ${{ secrets.GITHUB_TOKEN }}