Skip to content

Restructure workflows #39

Restructure workflows

Restructure workflows #39

Workflow file for this run

name: CI
on:
push:
branches: [ main ]
env:
DEBS_PATH: ${{ vars.DEBS_PATH || '~/debs' }}
REPO_PATH: ${{ vars.REPO_PATH || '~/repo' }}
TERM: xterm # needed for colored output of unittests
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Install shellcheck
run: sudo apt-get install shellcheck
- uses: pre-commit/[email protected]
id: precommit
- name: Upload pre-commit changes
if: failure() && steps.precommit.outcome == 'failure'
uses: rhaschke/upload-git-patch-action@main
with:
name: pre-commit
unittests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- run: ./test/bats/bin/bats --formatter pretty test/*.bats
- name: Check that *.js scripts are all identical to main.js
run: |
err=0
for f in $(find . -iname "*.js"); do
if ! diff -q $f main.js; then
echo "::warning:: $f differs from main.js"
err=1
fi
done
exit $err
ci:
runs-on: ubuntu-latest
needs: unittests
strategy:
fail-fast: false
matrix:
DEB_DISTRO: [focal, jammy, bookworm ]
ROS_DISTRO: [one]
env:
DEB_DISTRO: ${{ matrix.DEB_DISTRO }}
ROS_DISTRO: ${{ matrix.ROS_DISTRO }}
DEBUG_BASH: ${{ secrets.ACTIONS_STEP_DEBUG && 'true' || '' }}
name: minimal-${{ matrix.DEB_DISTRO }}-${{ matrix.ROS_DISTRO }}
steps:
- uses: actions/checkout@v3
- name: Run main action
uses: ./
with:
DEB_DISTRO: ${{ matrix.DEB_DISTRO }}
ROS_DISTRO: ${{ matrix.ROS_DISTRO }}
ROS_SOURCES: .github/workflows/minimal.repos
- name: Upload debs
uses: actions/upload-artifact@v3
with:
name: minimal-${{ matrix.DEB_DISTRO }}-${{ matrix.ROS_DISTRO }}.debs
path: $DEBS_PATH
- name: Run flat-repo action
uses: ./flat-repo
- name: Upload repo
uses: actions/upload-artifact@v3
with:
name: minimal-${{ matrix.DEB_DISTRO }}-${{ matrix.ROS_DISTRO }}
path: ${{ env.REPO_PATH }} # upload cannot interpret $REPO_PATH
if-no-files-found: error