Skip to content

Add: Tests on local runners with shared USB resources #258

Add: Tests on local runners with shared USB resources

Add: Tests on local runners with shared USB resources #258

Workflow file for this run

name: Test all targets
env:
GITHUB_CHECKOUT_VERSION: 'v4.2.1'
GITHUB_DOWNLOAD_ARTIFACT_VERSION: 'v4'
GITHUB_UPLOAD_ARTIFACT_VERSION: 'v4.4.3'
on: [push, pull_request]
jobs:
quick-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@${{ env.GITHUB_CHECKOUT_VERSION }}

Check failure on line 14 in .github/workflows/action.yml

View workflow run for this annotation

GitHub Actions / Test all targets

Invalid workflow file

The workflow is not valid. .github/workflows/action.yml (Line: 14, Col: 13): Unrecognized named-value: 'env'. Located at position 1 within expression: env.GITHUB_CHECKOUT_VERSION .github/workflows/action.yml (Line: 30, Col: 13): Unrecognized named-value: 'env'. Located at position 1 within expression: env.GITHUB_CHECKOUT_VERSION
- uses: actions-rs/[email protected]
with:
toolchain: stable
override: true
- name: Check Type
run: cargo fmt -- --check
- name: Run internal tests
run: cargo test --verbose -- --nocapture
- name: Build
run: cargo build
build:
needs: quick-tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@${{ env.GITHUB_CHECKOUT_VERSION }}
- uses: actions-rs/[email protected]
with:
toolchain: stable
override: true
- name: Build docs
run: cargo doc
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.ref == 'refs/heads/master' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./target/doc
compile-examples:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@${{ env.GITHUB_CHECKOUT_VERSION }}
- name: Compile examples for ARM v7
uses: houseabsolute/[email protected]
with:
target: armv7-unknown-linux-gnueabihf
args: "--examples --release"
- name: Upload compiled examples
uses: actions/upload-artifact@${{ env.GITHUB_UPLOAD_ARTIFACT_VERSION }}
with:
name: examples-armv7
path: target/armv7-unknown-linux-gnueabihf/release/examples/*
local-tests:
needs: compile-examples
runs-on: raspbian-armv7-kernel-5.10.33
if: ${{ github.repository_owner == 'bluerobotics' }}
steps:
- name: Run USB management script
run: /etc/github_runner/ci_management.sh
- name: Checkout repository
uses: actions/checkout@${{ env.GITHUB_CHECKOUT_VERSION }}
- name: Download compiled examples
uses: actions/download-artifact@${{ env.GITHUB_DOWNLOAD_ARTIFACT_VERSION }}
with:
name: examples-armv7
path: ./examples
- name: Make examples executable
run: |
chmod +x ./examples/*
- name: Run Tests
env:
STOP_ON_FAILURE: "false" # Set to "true" to stop on first failure
run: |
/etc/github_runner/run-tests.sh \
"Basic Ping1D Test w Ping1:ping_1d:--serial-port /dev/ttyUSB_Ping1:30" \
"Basic Ping1D Test w Ping2:ping_1d:--serial-port /dev/ttyUSB_Ping2:30"
# Test Name:Example Name:Additional Args:Timeout
- name: Post CI management script
if: always()
run: |
source /etc/github_runner/ci_management.sh
clear_busy_state
deploy:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Checkout to repository
uses: actions/checkout@${{ env.GITHUB_CHECKOUT_VERSION }}
with:
submodules: recursive
- name: Setup Rust toolchain
uses: actions-rs/[email protected]
with:
toolchain: stable
override: true
- name: Install cargo-bump
run: cargo install cargo-bump --force
- name: Modify version with tag
run: cargo bump ${{ github.ref_name }}
- name: Automatic commit for crate version upgrade
uses: stefanzweifel/git-auto-commit-action@v4
with:
branch: master
commit_message: "Cargo: Update the crate version to ${{ github.ref_name }}"
- name: Publish to crates.io
uses: katyo/publish-crates@v1
with:
args: --allow-dirty
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}