Skip to content

Commit

Permalink
Rework some sharp edges in GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
cottsay committed Feb 13, 2024
1 parent b1e38de commit bdabad7
Showing 1 changed file with 17 additions and 20 deletions.
37 changes: 17 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,8 @@ on:


jobs:
bionic-ci:
focal-ci:
runs-on: ubuntu-20.04
name: Focal Aptly ${{ matrix.job_type }} -
debug ${{ matrix.show_debug_cmds }}
strategy:
matrix:
show_debug_cmds:
- true
- false
job_type:
- 'CI'
- 'CONFIG_TESTER'
exclude:
- job_type: 'CONFIG_TESTER'
show_debug_cmds: false
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down Expand Up @@ -69,21 +56,31 @@ jobs:
# CI TESTING
- name: Run CI tests
if: ${{ matrix.job_type == 'CI' }}
if: ${{ github.event_name != 'pull_request' }}
run: |
python3 scripts/aptly/aptly_importer_TEST.py
env:
_DEBUG_MSGS_REPREPRO_UPDATER_TEST_SUITE_: ${{ matrix.show_debug_cmds }}
_DEBUG_MSGS_REPREPRO_UPDATER_TEST_SUITE_: false
_ALLOW_DESTRUCTIVE_TESTS_REPREPRO_UPDATER_TEST_SUITE_: true

# CI TESTING (debug)
- name: Run CI tests (debug)
if: ${{ github.event_name != 'pull_request' }}
run: |
python3 scripts/aptly/aptly_importer_TEST.py
env:
_DEBUG_MSGS_REPREPRO_UPDATER_TEST_SUITE_: true
_ALLOW_DESTRUCTIVE_TESTS_REPREPRO_UPDATER_TEST_SUITE_: true

# CONFIG FILE TESTER
- name: Idenfify files changed in this PR.
id: files
if: ${{ matrix.job_type == 'CONFIG_TESTER' }}
if: ${{ github.event_name == 'pull_request' }}
run: |
git diff --name-only origin/${{ github.base_ref }}...origin/${{ github.head_ref }}
echo "::set-output name=changed-files::$(git diff --name-only origin/${{ github.base_ref }}...origin/${{ github.head_ref }}| tr '\n' ' ')"
CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }}... | tr '\n' ' ')
echo "changed-files=$CHANGED_FILES" | tee $GITHUB_OUTPUT
- name: Run testing on changed config files
if: ${{ matrix.job_type == 'CONFIG_TESTER' }}
if: ${{ github.event_name == 'pull_request' }}
run: |
for changed_file in ${{ steps.files.outputs.changed-files }}; do
if [[ ${changed_file} != ${changed_file/config\/*.yaml} ]]; then
Expand Down

0 comments on commit bdabad7

Please sign in to comment.