Skip to content

Test

Test #2

Workflow file for this run

# Run tests on successful completion of the 'Static' workflow
# by ignoring all branches but 'master' and 'dev'.
name: Test
on:
workflow_run:
workflows: [ "Static" ]
types:
- "completed"
branches:
- master
- dev
- 'release/**'
env:
RUST_VERSIONS: "['1.69.0','stable','beta']"
APT_DEPENDENCIES: "['libasound2-dev']"
jobs:
get-env-vars:
name: Get Environment vars
runs-on: ubuntu-latest
outputs:
RUST_VERSIONS: ${{ env.RUST_VERSIONS }}
APT_DEPENDENCIES: ${{ env.APT_DEPENDENCIES }}
steps:
- run: echo "null"
test:
name: Test Suite on rust '${{ matrix.rust }}'
runs-on: ubuntu-latest
needs: [ get-env-vars ]
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#running-a-workflow-based-on-the-conclusion-of-another-workflow
if: ${{ github.event.workflow_run.conclusion == 'success' }}
strategy:
matrix:
rust: ${{ fromJSON(needs.get-env-vars.outputs.RUST_VERSIONS) }}
steps:
- name: Checkout sources
uses: actions/checkout@v2
with:
submodules: recursive
- name: Install deps
if: ${{ fromJSON(needs.get-env-vars.outputs.APT_DEPENDENCIES)[0] != null }}
run: sudo apt-get -y install ${{ join(fromJSON(needs.get-env-vars.outputs.APT_DEPENDENCIES), ' ') }}
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true
- name: Cache cargo registry
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-${{ matrix.rust }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo_registry-
- name: Cache cargo build
uses: actions/cache@v2
with:
path: target
key: ${{ runner.os }}-${{ matrix.rust }}-cargo_target-test-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
- ${{ runner.os }}-${{ matrix.rust }}-cargo_target-test-
- ${{ runner.os }}-${{ matrix.rust }}-cargo_target-
- name: Run cargo test
uses: actions-rs/cargo@v1
with:
command: test
args: --all-targets --all-features --workspace
# - name: Run cargo test (ignored)
# uses: actions-rs/cargo@v1
# with:
# command: test
# args: --all-targets --all-features --workspace -- --ignored