79 lines
2.1 KiB
YAML
79 lines
2.1 KiB
YAML
name: windows
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
build:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [vs2017-win2016]
|
|
rust_toolchain: [stable]
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- uses: actions/checkout@v1
|
|
- name: Install Rust
|
|
shell: cmd
|
|
run: |
|
|
curl -sSf -o rustup-init.exe https://win.rustup.rs
|
|
rustup-init.exe -yv --default-toolchain ${{ matrix.rust_toolchain }}
|
|
rustup update ${{ matrix.rust_toolchain }}
|
|
- name: Show versions
|
|
shell: cmd
|
|
run: |
|
|
set path "%USERPROFILE%\.cargo\bin;%PATH"
|
|
rustc -V
|
|
cargo -V
|
|
- name: Cache cargo registry
|
|
uses: actions/cache@v1
|
|
with:
|
|
path: ~/.cargo/registry
|
|
key: ${{ matrix.os }}-${{ matrix.rust_toolchain }}-cargo-registry-${{ hashFiles('Cargo.lock') }}
|
|
- name: Cache cargo index
|
|
uses: actions/cache@v1
|
|
with:
|
|
path: ~/.cargo/git
|
|
key: ${{ matrix.os }}-${{ matrix.rust_toolchain }}-cargo-index-${{ hashFiles('Cargo.lock') }}
|
|
- name: Cache cargo build
|
|
uses: actions/cache@v1
|
|
with:
|
|
path: target
|
|
key: ${{ matrix.os }}-${{ matrix.rust_toolchain }}-cargo-build-target-${{ hashFiles('Cargo.lock') }}
|
|
- name: Check formatting
|
|
if: matrix.rust_toolchain == 'stable'
|
|
shell: cmd
|
|
run: |
|
|
set path "%USERPROFILE%\.cargo\bin;%PATH"
|
|
rustup component add rustfmt
|
|
cargo fmt --all -- --check
|
|
- name: Build
|
|
shell: cmd
|
|
run: |
|
|
set path "%USERPROFILE%\.cargo\bin;%PATH"
|
|
cargo build --all --release
|
|
- name: Test
|
|
shell: cmd
|
|
run: |
|
|
set path "%USERPROFILE%\.cargo\bin;%PATH"
|
|
cargo test --all --release
|
|
- name: Package
|
|
shell: cmd
|
|
run: |
|
|
set path "%USERPROFILE%\.cargo\bin;%PATH"
|
|
bash ci/deploy.sh
|
|
- name: Move Windows Package
|
|
shell: bash
|
|
run: |
|
|
mkdir pkg_
|
|
mv *.zip pkg_
|
|
- uses: actions/upload-artifact@master
|
|
with:
|
|
name: windows
|
|
path: pkg_
|