Skip to content

Raspberry Pi Ansible Script #60

Raspberry Pi Ansible Script

Raspberry Pi Ansible Script #60

name: Test Self-Hosted Runner
on:
push:
branches:
- main
pull_request:
types:
- opened
- reopened
- synchronize
workflow_dispatch:
jobs:
setup:
runs-on: self-hosted
outputs:
all_projects_matrix: ${{ steps.projects.outputs.all_projects_matrix }}
modified_projects_matrix: ${{ steps.projects.outputs.modified_projects_matrix }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Python
run: |
python3 -m venv .venv
- name: Get projects
id: projects
run: |
source .venv/bin/activate
BASE_REF="${{ github.base_ref }}" # Target branch of the PR
BASE_REF="${BASE_REF:-HEAD^}" # Previous commit on push to main
python3 scripts/actions/all_projects.py
python3 scripts/actions/modified_projects.py origin/$BASE_REF
echo "all_projects_matrix=$(cat all_projects_matrix.json)" >> $GITHUB_OUTPUT
echo "modified_projects_matrix=$(cat modified_projects_matrix.json)" >> $GITHUB_OUTPUT
build-all-projects:
needs: setup
strategy:
fail-fast: false
matrix:
include: ${{ fromJson(needs.setup.outputs.all_projects_matrix) }}
uses: ./.github/workflows/reusable-build-project.yml
with:
project: ${{ matrix.project }}
platform: ${{ matrix.platform }}
build-modified-projects:
needs: setup
strategy:
fail-fast: false
matrix:
include: ${{ fromJson(needs.setup.outputs.modified_projects_matrix) }}
uses: ./.github/workflows/reusable-build-project.yml
with:
project: ${{ matrix.project }}
platform: ${{ matrix.platform }}