[WF-293] Restart core charm services when airflow.cfg changes #100
Workflow file for this run
This file contains hidden or 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: tests | |
| on: | |
| pull_request: | |
| workflow_call: | |
| inputs: | |
| directories: | |
| required: false | |
| type: string | |
| default: '["charms/api-server","charms/scheduler","charms/dag-processor","charms/triggerer"]' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| lib-check: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| charm-path: ${{ fromJSON(inputs.directories || '["charms/api-server","charms/scheduler","charms/dag-processor","charms/triggerer"]') }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 1 | |
| - name: Check Libraries | |
| id: checklibs | |
| uses: canonical/charming-actions/check-libraries@2.7.0 | |
| with: | |
| credentials: "${{ secrets.CHARMHUB_TOKEN }}" | |
| github-token: "${{ secrets.GITHUB_TOKEN }}" | |
| charm-path: ${{ matrix.charm-path }} | |
| lint: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| directory: ${{ fromJSON(inputs.directories || '["charms/api-server","charms/scheduler","charms/dag-processor","charms/triggerer"]') }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Install dependencies | |
| run: | | |
| sudo snap install astral-uv --classic | |
| uv tool install tox | |
| - name: Run Linter | |
| working-directory: ${{ matrix.directory }} | |
| run: uv tool run tox -e lint | |
| unit-tests: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| directory: ${{ fromJSON(inputs.directories || '["charms/api-server","charms/scheduler","charms/dag-processor","charms/triggerer"]') }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Install dependencies | |
| run: | | |
| sudo snap install astral-uv --classic | |
| uv tool install tox | |
| - name: Run Tests | |
| working-directory: ${{ matrix.directory }} | |
| run: uv tool run tox -e unit | |
| discover-integration-tasks: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| matrix: ${{ steps.out.outputs.matrix }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Generate integration test matrix | |
| id: out | |
| shell: bash | |
| run: | | |
| FILES=$(ls -1 tests/integration/test_*.py 2>/dev/null || true) | |
| if [ -z "$FILES" ]; then | |
| echo 'matrix={"include":[]}' >> "$GITHUB_OUTPUT" | |
| exit 0 | |
| fi | |
| MATRIX=$(printf '%s\n' $FILES | jq -R . | jq -s -c '{include: map({test_file: .})}') | |
| echo "matrix=$MATRIX" >> "$GITHUB_OUTPUT" | |
| integration-tests: | |
| needs: [lint, unit-tests, discover-integration-tasks] | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: ${{ fromJSON(needs.discover-integration-tasks.outputs.matrix) }} | |
| if: ${{ needs.discover-integration-tasks.outputs.matrix != '{"include":[]}' }} | |
| steps: | |
| - name: Maximise GH runner space | |
| uses: jlumbroso/free-disk-space@v1.3.1 | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Install dependencies (concierge) | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| sudo apt-get update | |
| sudo apt-get purge -y $(dpkg -l | grep -i docker | awk '{print $2}') || true | |
| sudo apt-get purge -y containerd.io || true | |
| sudo rm -rf /run/containerd || true | |
| sudo snap install concierge --classic | |
| sudo -E concierge prepare -p k8s --extra-snaps=astral-uv,just | |
| mkdir -p ~/.kube | |
| sudo k8s kubectl config view --raw > ~/.kube/config | |
| uv tool install tox | |
| - name: Run integration test file | |
| run: just integration ${{ matrix.test_file }} | |
| - name: Get system state | |
| run: just get-system-state |