Merge windows and linux builds

This commit is contained in:
Sebastian Wiesner 2020-06-01 13:02:24 +02:00
parent f26a9c75a8
commit 19f53f8993

View file

@ -9,24 +9,29 @@ on:
- master - master
jobs: jobs:
build-test-unix: test:
runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
conf: target:
- minimum-stable - x86_64-unknown-linux-gnu
- latest-stable - x86_64-pc-windows-msvc
- latest-beta toolchain:
- latest-nightly # Minimum stable
- "1.41.0"
- stable
- beta
- nightly
include: include:
- conf: minimum-stable - target: x86_64-unknown-linux-gnu
toolchain: 1.41.0 os: ubuntu-latest
- conf: latest-stable - target: x86_64-pc-windows-msvc
toolchain: stable os: windows-latest
- conf: latest-beta exclude:
toolchain: beta - target: x86_64-pc-windows-msvc
- conf: latest-nightly rust: beta
toolchain: nightly - target: x86_64-pc-windows-msvc
rust: nightly
runs-on: ${{ matrix.os }}
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Install ${{ matrix.toolchain }} - name: Install ${{ matrix.toolchain }}
@ -40,9 +45,9 @@ jobs:
uses: actions/cache@v1 uses: actions/cache@v1
with: with:
path: ~/.cargo/registry/cache path: ~/.cargo/registry/cache
key: ${{ runner.os }}-${{ matrix.conf }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} key: ${{ matrix.target }}-${{ matrix.toolchain }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: | restore-keys: |
${{ runner.os }}-${{ matrix.conf }}-cargo-registry- ${{ matrix.target }}-${{ matrix.toolchain }}-cargo-registry-
- name: Run rustfmt - name: Run rustfmt
if: matrix.toolchain == 'stable' if: matrix.toolchain == 'stable'
uses: actions-rs/cargo@v1 uses: actions-rs/cargo@v1
@ -68,54 +73,3 @@ jobs:
with: with:
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
args: --no-default-features -- -D warnings args: --no-default-features -- -D warnings
build-test-windows:
runs-on: windows-latest
strategy:
matrix:
conf:
- minimum-stable
- latest-stable
include:
- conf: minimum-stable
toolchain: 1.41.0
- conf: latest-stable
toolchain: stable
steps:
- uses: actions/checkout@v2
- name: Install ${{ matrix.toolchain }}
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.toolchain }}
override: true
components: clippy, rustfmt
- name: Cache cargo registry
uses: actions/cache@v1
with:
path: ~/.cargo/registry/cache
key: ${{ runner.os }}-${{ matrix.conf }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.conf }}-cargo-registry-
- name: Run rustfmt
if: matrix.toolchain == 'stable'
uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check
- name: Run clippy
if: matrix.toolchain == 'stable'
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: -- -D warnings
- name: Run tests
run: cargo test
- name: Build docs
run: cargo doc --no-deps
- name: Check no default features
if: matrix.toolchain == 'stable'
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --no-default-features -- -D warnings