Skip to content

feat: only run CI jobs if features were modified #109

feat: only run CI jobs if features were modified

feat: only run CI jobs if features were modified #109

Workflow file for this run

name: "CI - Test Features"
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
changes:
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
# Expose matched filters as job 'features' output variable
features: ${{ steps.filter.outputs.changes }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
android-sdk:
- src/android-sdk/**
- test/android-sdk/**
burp-suite:
- src/burp-suite/**
- test/burp-suite/**
coder:
- src/coder/**
- test/coder/**
cutter:
- src/cutter/**
- test/cutter/**
ghidra:
- src/ghidra/**
- test/ghidra/**
lib-common:
- src/lib-common/**
- test/lib-common/**
lib-github:
- src/lib-github/**
- test/lib-github/**
test-autogenerated:
needs: changes
if: needs.changes.outputs.features != '[]' # Empty array
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
features: ${{ fromJSON(needs.changes.outputs.features) }}
baseImage:
- debian:latest
- ubuntu:latest
- mcr.microsoft.com/devcontainers/base:ubuntu
steps:
- uses: actions/checkout@v4
- name: "Install latest devcontainer CLI"
run: npm install -g @devcontainers/cli
- name: "Generating tests for '${{ matrix.features }}' against '${{ matrix.baseImage }}'"
run: devcontainer features test --skip-scenarios -f ${{ matrix.features }} -i ${{ matrix.baseImage }} .
test-scenarios:
needs: changes
if: needs.changes.outputs.features != '[]' # Empty array
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
features: ${{ fromJSON(needs.changes.outputs.features) }}
steps:
- uses: actions/checkout@v4
- name: "Install latest devcontainer CLI"
run: npm install -g @devcontainers/cli
- name: "Generating tests for '${{ matrix.features }}' scenarios"
run: devcontainer features test -f ${{ matrix.features }} --skip-autogenerated --skip-duplicated .
test-global:
needs: changes
if: needs.changes.outputs.features != '[]' # Empty array
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v4
- name: "Install latest devcontainer CLI"
run: npm install -g @devcontainers/cli
- name: "Testing global scenarios"
run: devcontainer features test --global-scenarios-only .