Skip to content
Merged
Show file tree
Hide file tree
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
22 changes: 15 additions & 7 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ on:
branches: [ main ]
paths:
- '.github/workflows/codeql-analysis.yml'
- 'repo-config.yml'
- 'scripts/*.py'
- 'pyproject.toml'
- 'poetry.lock'
Expand All @@ -34,6 +35,7 @@ on:
- 'main'
paths:
- '.github/workflows/codeql-analysis.yml'
- 'repo-config.yml'
- 'scripts/*.py'
- 'pyproject.toml'
- 'poetry.lock'
Expand All @@ -59,20 +61,20 @@ jobs:

outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
changed-files: ${{ steps.changed-files.outputs.all_changed_files }}
changed-files: ${{ steps.changed-files.outputs.files }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Get changed code files
id: changed-files
uses: tj-actions/changed-files@v45
uses: yumemi-inc/changed-files@v3

- name: List all relevant changed files
if: steps.changed-files.outputs.any_changed == 'true'
if: steps.changed-files.outputs.exists == 'true'
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.files }}
run: |
for file in ${ALL_CHANGED_FILES}; do
echo "$file was changed"
Expand All @@ -82,7 +84,7 @@ jobs:
- name: Get CodeQL Languages
id: set-matrix
run: |
matrix=$(python scripts/get_codeql_languages.py --event ${{ github.event_name}} ${{ steps.changed-files.outputs.all_changed_files }})
matrix=$(python scripts/get_codeql_languages.py --event ${{ github.event_name}} ${{ steps.changed-files.outputs.files }})
echo "${matrix}"
echo "matrix={\"include\": ${matrix}}" >> $GITHUB_OUTPUT

Expand Down Expand Up @@ -122,15 +124,21 @@ jobs:
if: ${{ github.event_name == 'pull_request' }}
run: rm -f ${{ matrix.paths-ignore }}

- name: Read repo config
uses: pietrobolcato/[email protected]
id: repo-config
with:
config: repo-config.yml

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: "${{ steps.repo-config.outputs['python-version'] }}"

- name: Run Poetry Image
uses: abatilo/actions-poetry@v3
with:
poetry-version: "2.1.1"
poetry-version: "${{ steps.repo-config.outputs['poetry-version'] }}"

- name: Install Dependencies
run: poetry install
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/readme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
paths:
- 'archive/**'
- '.glotter.yml'
- 'repo-config.yml'
- '.github/workflows/readme.yml'
- 'pyproject.toml'
- 'poetry.lock'
Expand All @@ -17,26 +18,25 @@ jobs:
readme:
name: "README Generation"

strategy:
fail-fast: true
matrix:
python-version: ["3.11"]
poetry-version: ["2.1.1"]
os: [ubuntu-latest]

runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4


- name: Read repo config
uses: pietrobolcato/[email protected]
id: repo-config
with:
config: repo-config.yml

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
python-version: "${{ steps.repo-config.outputs['python-version'] }}"

- name: Run Poetry Image
uses: abatilo/actions-poetry@v3
with:
poetry-version: ${{ matrix.poetry-version }}
poetry-version: "${{ steps.repo-config.outputs['poetry-version'] }}"

- name: Install Dependencies
run: poetry install
Expand Down
39 changes: 19 additions & 20 deletions .github/workflows/test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
paths:
- 'archive/**'
- '.glotter.yml'
- 'repo-config.yml'
- '.github/workflows/test-suite.yml'
- 'pyproject.toml'
- 'poetry.lock'
Expand All @@ -28,31 +29,31 @@ jobs:
runs-on: ubuntu-latest

outputs:
status: ${{ steps.changed-files.outputs.any_changed }}
changed_files: ${{ steps.changed-files.outputs.all_changed_files }}
status: ${{ steps.changed-files.outputs.exists }}
changed_files: ${{ steps.changed-files.outputs.files }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Get changed code files
id: changed-files
uses: tj-actions/changed-files@v45
uses: yumemi-inc/changed-files@v3
with:
files: |
patterns: |
archive/**
.glotter.yml
repo-config.yml
.github/workflows/test-suite.yml
pyproject.toml
poetry.lock
scripts/run_tests.py
files_ignore: |
**/*.md
!**/*.md

- name: List all relevant changed files
if: steps.changed-files.outputs.any_changed == 'true'
if: steps.changed-files.outputs.exists == 'true'
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.files }}
run: |
for file in ${ALL_CHANGED_FILES}; do
echo "$file was changed"
Expand All @@ -64,29 +65,27 @@ jobs:
needs: changed-files
if: needs.changed-files.outputs.status == 'true' || ${{ github.event_name == 'schedule' }}

strategy:
fail-fast: true
matrix:
python-version: ["3.11"]
poetry-version: ["2.1.1"]
os: [ubuntu-latest]
num_batches: [6]

runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Read repo config
uses: pietrobolcato/[email protected]
id: repo-config
with:
config: repo-config.yml

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
python-version: "${{ steps.repo-config.outputs['python-version'] }}"

- name: Run Poetry Image
uses: abatilo/actions-poetry@v3
with:
poetry-version: ${{ matrix.poetry-version }}
poetry-version: "${{ steps.repo-config.outputs['poetry-version'] }}"

- name: Install Dependencies
run: poetry install
Expand All @@ -97,7 +96,7 @@ jobs:
- name: Download Docker images, Test Appropriate Sample Programs, Remove Docker Images
run: poetry run python scripts/run_tests.py
--event ${{ github.event_name }}
--num-batches ${{ matrix.num_batches }}
--num-batches ${{ steps.repo-config.outputs['num-batches'] }}
--parallel
--remove
${{ needs.changed-files.outputs.changed_files }}
Expand Down
3 changes: 3 additions & 0 deletions repo-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
poetry-version: "2.1.1"
python-version: "3.11"
num-batches: 6
1 change: 1 addition & 0 deletions scripts/get_codeql_languages.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class LanguageInfo:
}
ALL_CODEQL_LANGUAGES_FILES = {
".github/workflows/codeql-analysis.yml",
"repo-config.yml",
"scripts/get_codeql_languages.py",
"scripts/build_codeql_language.py",
"pyproject.toml",
Expand Down
1 change: 1 addition & 0 deletions scripts/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

RUN_EVERYTHING_PATHS = {
Path(".glotter.yml"),
Path("repo-config.yml"),
Path("pyproject.toml"),
Path("poetry.lock"),
Path(".github/workflows/test-suite.yml"),
Expand Down