Add windows + caching to github workflow
This commit is contained in:
parent
0a847b9d2a
commit
02dc2cf711
1 changed files with 36 additions and 12 deletions
48
.github/workflows/rust.yml
vendored
48
.github/workflows/rust.yml
vendored
|
@ -10,20 +10,44 @@ env:
|
||||||
CARGO_TERM_COLOR: always
|
CARGO_TERM_COLOR: always
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
linux_job:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Run tests
|
- name: Cache build
|
||||||
run: cargo test --verbose
|
uses: actions/cache@v2
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- name: Build linux
|
|
||||||
run: cargo build --release
|
|
||||||
- name: Build
|
|
||||||
uses: actions/upload-artifact@v2.2.4
|
|
||||||
with:
|
with:
|
||||||
name: "$GITHUB_HEAD_REF-linux"
|
path: ~/target
|
||||||
|
key: ${{ runner.os }}-build-${{ hashFiles('**/Cargo.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-build-${{ hashFiles('**/Cargo.lock') }}
|
||||||
|
${{ runner.os }}-build-
|
||||||
|
${{ runner.os }}-
|
||||||
|
- run: cargo build --release
|
||||||
|
- run: cargo test --release
|
||||||
|
- name: Upload build file
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: linux
|
||||||
path: target/release/autoconfig
|
path: target/release/autoconfig
|
||||||
|
|
||||||
|
windows_job:
|
||||||
|
runs-on: windows-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Cache build
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ~/target
|
||||||
|
key: ${{ runner.os }}-build-${{ hashFiles('**/Cargo.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-build-${{ hashFiles('**/Cargo.lock') }}
|
||||||
|
${{ runner.os }}-build-
|
||||||
|
${{ runner.os }}-
|
||||||
|
- run: cargo build --release
|
||||||
|
- run: cargo test --release
|
||||||
|
- name: Upload build file
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: windows
|
||||||
|
path: target/release/autoconfig.exe
|
||||||
|
|
Reference in a new issue