Add workflow dispatch to workflow (#82) #71
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- '.github/workflows/driver-cross-build.yml' | |
- '.test/bin/**' | |
- '.test/lint.sh' | |
- 'src/drivers/**' | |
workflow_dispatch: | |
pull_request: | |
types: [opened, synchronize] | |
paths: | |
- '.github/workflows/driver-cross-build.yml' | |
- '.test/bin/**' | |
- '.test/lint.sh' | |
- 'src/drivers/**' | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
- name: Lint | |
run: | | |
./.test/lint.sh | |
build: | |
needs: lint | |
strategy: | |
fail-fast: false | |
matrix: | |
env: | |
- { RPI_LINUX_VER: rpi-5.4.y, CONFIG_FILE: config-5.4.83-v7+, RPI_LINUX_COMMIT_HASH: 76c49e6, GCC_VER: 6.3 } | |
- { RPI_LINUX_VER: rpi-5.4.y, CONFIG_FILE: config-5.4.83-v7+, RPI_LINUX_COMMIT_HASH: 76c49e6, GCC_VER: 8.3 } | |
- { RPI_LINUX_VER: rpi-5.10.y, CONFIG_FILE: config-5.10.11-v7+, RPI_LINUX_COMMIT_HASH: 6af8ae3, GCC_VER: 6.3 } | |
- { RPI_LINUX_VER: rpi-5.10.y, CONFIG_FILE: config-5.10.11-v7+, RPI_LINUX_COMMIT_HASH: 6af8ae3, GCC_VER: 8.3 } | |
- { RPI_LINUX_VER: rpi-5.15.y, CONFIG_FILE: config-5.15.61-v7l+, RPI_LINUX_COMMIT_HASH: 5b775d7, GCC_VER: 10.2 } | |
- { RPI_LINUX_VER: rpi-5.15.y, CONFIG_FILE: config-5.15.76-v7l+, RPI_LINUX_COMMIT_HASH: 45d339389bb85588b8045dd40a00c54d01e2e711, GCC_VER: 10.2 } | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install cross-build settings | |
id: gcc | |
env: | |
GCC_VER: ${{ matrix.env.GCC_VER }} | |
SRC_DIR: ${{ github.workspace }} | |
run: | | |
source ./.test/step0.sh | |
prepare_cross_compiler | |
echo "path=${CROSS_COMPILE_PATH}" >> $GITHUB_OUTPUT | |
- name: Install kernel headers | |
env: | |
RPI_LINUX_VER: ${{ matrix.env.RPI_LINUX_VER }} | |
CONFIG_FILE: ${{ matrix.env.CONFIG_FILE }} | |
RPI_LINUX_COMMIT_HASH: ${{ matrix.env.RPI_LINUX_COMMIT_HASH }} | |
GCC_VER: ${{ matrix.env.GCC_VER }} | |
CROSS_COMPILE_PATH: ${{ steps.gcc.outputs.path }} | |
SRC_DIR: ${{ github.workspace }} | |
run: | | |
source ./.test/step1.sh | |
install_kernel_headers | |
- name: Build kernel module | |
env: | |
CROSS_COMPILE_PATH: ${{ steps.gcc.outputs.path }} | |
SRC_DIR: ${{ github.workspace }} | |
run: | | |
source ./.test/step2.sh | |
build_kernel_module | |