2021-01-24 17:02:12 +00:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
2021-01-24 17:03:06 +00:00
|
|
|
push:
|
|
|
|
branches: [ master ]
|
|
|
|
pull_request:
|
|
|
|
branches: [ master ]
|
2021-01-24 17:02:12 +00:00
|
|
|
|
|
|
|
env:
|
2021-01-24 17:03:06 +00:00
|
|
|
CARGO_TERM_COLOR: always
|
2021-01-24 17:02:12 +00:00
|
|
|
|
|
|
|
jobs:
|
2021-01-24 17:03:06 +00:00
|
|
|
build:
|
2021-01-24 17:02:12 +00:00
|
|
|
|
2021-01-24 17:03:06 +00:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest, windows-latest]
|
2021-01-24 17:02:12 +00:00
|
|
|
|
2021-01-24 17:03:06 +00:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Install Rust toolchain
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
2021-01-24 17:02:12 +00:00
|
|
|
|
2021-01-24 17:03:06 +00:00
|
|
|
- name: Cache cargo directories
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.cargo/registry
|
|
|
|
~/.cargo/git
|
|
|
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
2021-01-24 17:02:12 +00:00
|
|
|
|
2021-01-24 17:03:06 +00:00
|
|
|
- name: Cache cargo target dir
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: target
|
|
|
|
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
|
|
|
|
- name: Build
|
|
|
|
run: cargo build --release --verbose
|
|
|
|
# there are currently no automated tests
|
|
|
|
- name: Run tests
|
2021-01-24 17:18:00 +00:00
|
|
|
run: cargo test --release --verbose
|
|
|
|
- name: Archive artifacts
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: Binaries
|
|
|
|
path: |
|
|
|
|
target/release/KIT-ILIAS-downloader
|
|
|
|
target/release/KIT-ILIAS-downloader.exe
|