Skip to content

Commit

Permalink
CI: expand GH actions a bit more
Browse files Browse the repository at this point in the history
  • Loading branch information
wez committed Apr 14, 2020
1 parent aee6225 commit ce620f8
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 30 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: macos

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
build:
strategy:
fail-fast: false
runs-on: "macos-latest"
steps:
- uses: actions/checkout@v1
- name: "Install Rust"
uses: actions-rs/toolchain@v1
with:
profile: "minimal"
toolchain: "stable"
override: true
components: "rustfmt"
- name: "Cache cargo registry"
uses: actions/cache@v1
with:
path: "~/.cargo/registry"
key: "macos-${{ hashFiles('Cargo.lock') }}-cargo-registry"
- name: "Cache cargo index"
uses: actions/cache@v1
with:
path: "~/.cargo/git"
key: "macos-${{ hashFiles('Cargo.lock') }}-cargo-index"
- name: "Cache cargo build"
uses: actions/cache@v1
with:
path: "target"
key: "macos-${{ hashFiles('Cargo.lock') }}-cargo-build-target"
- name: Check formatting
run: cargo fmt --all -- --check
- name: Build
run: cargo build --all --release
- name: Test
run: cargo test --all
- name: Move Windows Package
shell: bash
run: |
mkdir pkg_
mv target/release/*.exe pkg_
- uses: actions/upload-artifact@master
with:
name: macos
path: pkg_

57 changes: 27 additions & 30 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,41 +12,38 @@ jobs:
build:
strategy:
fail-fast: false
matrix:
os: [vs2017-win2016]
rust_toolchain: [stable]
runs-on: ${{ matrix.os }}
runs-on: "vs2017-win2016"
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: "Install Rust"
uses: actions-rs/toolchain@v1
with:
profile: "minimal"
toolchain: "stable"
override: true
components: "rustfmt"
target: "x86_64-pc-windows-msvc"
- name: "Cache cargo registry"
uses: actions/cache@v1
with:
path: "~/.cargo/registry"
key: "windows-x86_64-pc-windows-msvc-${{ hashFiles('Cargo.lock') }}-cargo-registry"
- name: "Cache cargo index"
uses: actions/cache@v1
with:
path: "~/.cargo/git"
key: "windows-x86_64-pc-windows-msvc-${{ hashFiles('Cargo.lock') }}-cargo-index"
- name: "Cache cargo build"
uses: actions/cache@v1
with:
path: "target"
key: "windows-x86_64-pc-windows-msvc-${{ hashFiles('Cargo.lock') }}-cargo-build-target"
- 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
run: cargo fmt --all -- --check
- name: Build
shell: cmd
run: |
set path "%USERPROFILE%\.cargo\bin;%PATH"
cargo build --all --release
run: cargo build --all --release
- name: Test
shell: cmd
run: |
set path "%USERPROFILE%\.cargo\bin;%PATH"
cargo test --all
run: cargo test --all
- name: Move Windows Package
shell: bash
run: |
Expand Down

0 comments on commit ce620f8

Please sign in to comment.