Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify glotter workflow to check for changed code files #3910

Merged
merged 7 commits into from
Oct 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 38 additions & 5 deletions .github/workflows/test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ name: Glotter
on:
push:
branches: [ main ]
pull_request:
branches:
- 'main'
paths:
- 'archive/**'
- 'test/**'
Expand All @@ -16,6 +13,9 @@ on:
- 'pyproject.toml'
- 'poetry.lock'
- '!**/README.md'
pull_request:
branches:
- 'main'

jobs:
testing:
Expand All @@ -32,22 +32,55 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4

with:
fetch-depth: ${{ github.event_name == 'pull_request' && 2 || 0 }}

- name: Get changed code files
id: changed-files
uses: tj-actions/changed-files@v45
with:
files: |
archive/**
test/**
.glotter.yml
.github/workflows/test-suite.yml
pyproject.toml
poetry.lock
!**/README.md

- name: Show changed code files
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
echo "Changed code files:"
for file in ${ALL_CHANGED_FILES}; do
echo "- $file"
done

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
if: steps.changed-files.outputs.any_changed == 'true'

- name: Run Poetry Image
uses: abatilo/actions-poetry@v3
with:
poetry-version: ${{ matrix.poetry-version }}

if: steps.changed-files.outputs.any_changed == 'true'

- name: Install Dependencies
run: poetry install
if: steps.changed-files.outputs.any_changed == 'true'

- name: Check for Bad Files
run: poetry run glotter check
if: steps.changed-files.outputs.any_changed == 'true'

- name: Download Docker images, Test All Sample Programs, Remove Docker Images
run: poetry run glotter batch ${{ matrix.num_batches }} --parallel --remove
if: steps.changed-files.outputs.any_changed == 'true'

- name: Do nothing if no code changes
run: echo "No code changes"
if: steps.changed-files.outputs.any_changed == 'false'