74 lines
1.9 KiB
YAML
74 lines
1.9 KiB
YAML
name: Rust
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
pull_request:
|
|
branches: [ main ]
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
|
|
jobs:
|
|
linux_job:
|
|
runs-on: ubuntu-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: linux
|
|
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
|
|
|
|
macos_job:
|
|
runs-on: macos-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: macos
|
|
path: target/release/autoconfig
|