Skip to content
This repository has been archived by the owner on Jun 7, 2022. It is now read-only.

21 advanced GitHub actions #22

Merged
merged 9 commits into from
Sep 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
124 changes: 124 additions & 0 deletions .github/workflows/full.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
name: Full

on:
push:
branches: [ never ]
pull_request:
branches: [ never ]

env:
CARGO_TERM_COLOR: always

jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]

steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: minimal
- uses: actions/cache@v2.1.1
with:
path: |
target
~/.cargo/registry
~/.cargo/git
# key: ${{ runner.OS }}-target-${{ github.sha }}-${{ github.job }}
key: ${{ runner.OS }}-target-${{ github.sha }}
restore-keys: |
${{ runner.OS }}-target-${{ github.sha }}
${{ runner.OS }}-target

- name: Install Linux dependencies
if: ${{ runner.OS == 'Linux' }}
run: |
sudo apt-get update
sudo apt-get install -y libasound2-dev libudev-dev

- name: Build
run: cargo build --verbose --workspace --all-targets

clippy:
name: Clippy lint
runs-on: ubuntu-latest
needs: [build]

steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: minimal
components: clippy
- uses: actions/cache@v2.1.1
with:
path: |
target
~/.cargo/registry
~/.cargo/git
# key: ${{ runner.OS }}-target-${{ github.sha }}-${{ github.job }}
key: ${{ runner.OS }}-target-${{ github.sha }}
restore-keys: |
${{ runner.OS }}-target-${{ github.sha }}
${{ runner.OS }}-target
- name: Install Linux dependencies
if: ${{ runner.OS == 'Linux' }}
run: |
sudo apt-get update
sudo apt-get install -y libasound2-dev libudev-dev

- name: Run clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --verbose --workspace --all-targets

test:
name: Run test suite
runs-on: ${{ matrix.os }}
needs: [clippy]
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]

steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: minimal
- uses: actions/cache@v2.1.1
with:
path: |
target
~/.cargo/registry
~/.cargo/git
# key: ${{ runner.OS }}-target-${{ github.sha }}-${{ github.job }}
key: ${{ runner.OS }}-target-${{ github.sha }}
restore-keys: |
${{ runner.OS }}-target-${{ github.sha }}
${{ runner.OS }}-target
- name: Install Linux dependencies
if: ${{ runner.OS == 'Linux' }}
run: |
sudo apt-get update
sudo apt-get install -y libasound2-dev libudev-dev

- name: Test
run: cargo test --verbose --workspace --all-targets

pass:
name: Passed
runs-on: ubuntu-latest
needs: [test]
steps:
- run: exit 0
32 changes: 0 additions & 32 deletions .github/workflows/rust.yml

This file was deleted.

62 changes: 62 additions & 0 deletions .github/workflows/simple.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Simple

on:
push:
branches: [ staging, trying ]
pull_request:
branches: [ master ]

env:
CARGO_TERM_COLOR: always

jobs:
full-check:
name: Check everything
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]

steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: minimal
components: clippy
- uses: actions/cache@v2.1.1
with:
path: |
target
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
key: ${{ runner.OS }}-simple-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.OS }}-simple

- name: Install Linux dependencies
if: ${{ runner.OS == 'Linux' }}
run: |
sudo apt-get update
sudo apt-get install -y libasound2-dev libudev-dev

- name: Build
run: cargo build --verbose --workspace --all-targets --locked

- name: Run clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --workspace --all-targets --all-features --locked -- -D warnings

- name: Test
run: cargo test --verbose --workspace --all-targets --locked

pass:
name: Passed
runs-on: ubuntu-latest
needs: [full-check]
steps:
- run: exit 0
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
/target
/test_assets
.vscode/settings.json
.vscode

Cargo.lock
Loading