Sebastian Schmidt
5 years ago
3 changed files with 119 additions and 31 deletions
@ -1,31 +1,60 @@ |
|||||
name: build-windows |
name: build-windows |
||||
|
|
||||
on: [push] |
on: [push, pull_request] |
||||
|
|
||||
jobs: |
jobs: |
||||
build: |
build: |
||||
|
|
||||
runs-on: windows-latest |
runs-on: windows-latest |
||||
|
|
||||
|
strategy: |
||||
|
matrix: |
||||
|
db-backend: [sqlite, mysql, postgresql] |
||||
|
|
||||
steps: |
steps: |
||||
- uses: actions/checkout@v1 |
- uses: actions/checkout@v1 |
||||
- name: install dependencies |
- name: Install dependencies |
||||
run: choco install sqlite openssl |
run: choco install openssl sqlite |
||||
|
|
||||
|
- name: Cache cargo registry |
||||
|
uses: actions/cache@v1.0.3 |
||||
|
with: |
||||
|
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 |
||||
|
uses: actions/cache@v1.0.3 |
||||
|
with: |
||||
|
path: target |
||||
|
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} |
||||
|
|
||||
- name: Install latest nightly |
- name: Install latest nightly |
||||
uses: actions-rs/toolchain@v1 |
uses: actions-rs/toolchain@v1 |
||||
with: |
with: |
||||
toolchain: nightly |
toolchain: nightly |
||||
override: true |
override: true |
||||
profile: minimal |
profile: minimal |
||||
- name: Cache |
|
||||
uses: actions/cache@v1.0.3 |
|
||||
with: |
|
||||
path: target |
|
||||
key: ${{ runner.os }} |
|
||||
- name: Build |
- name: Build |
||||
run: cargo.exe build --verbose --features sqlite --release |
run: cargo.exe build --verbose --features ${{ matrix.db-backend }} --release |
||||
|
|
||||
|
- name: Run tests |
||||
|
run: cargo test --features ${{ matrix.db-backend }} |
||||
|
|
||||
- name: Upload windows artifact |
- name: Upload windows artifact |
||||
uses: actions/upload-artifact@v1.0.0 |
uses: actions/upload-artifact@v1.0.0 |
||||
with: |
with: |
||||
name: x86_64-pc-windows-bitwarden_rs |
name: x86_64-pc-windows-${{ matrix.db-backend }}-bitwarden_rs |
||||
|
path: target/release/bitwarden_rs.exe |
||||
|
|
||||
|
- name: Release |
||||
|
uses: Shopify/upload-to-release |
||||
|
if: startsWith(github.ref, 'refs/tags/') |
||||
|
with: |
||||
|
name: x86_64-pc-windows-${{ matrix.db-backend }}-bitwarden_rs |
||||
path: target/release/bitwarden_rs.exe |
path: target/release/bitwarden_rs.exe |
||||
|
repo-token: ${{ secrets.GITHUB_TOKEN }} |
||||
|
Loading…
Reference in new issue