Conversation
| @@ -0,0 +1,45 @@ | |||
| name: Antares Simulator Update Detected | |||
| description: Automatically created when a new Antares Simulator release is detected | |||
| title: "[ANTARES UPDATE] New release: v" | |||
There was a problem hiding this comment.
Why "v" ? Either fetch the version numer or just remove it ?
| title: "[ANTARES UPDATE] New release: v" | |
| title: "[ANTARES UPDATE] New release: v" |
There was a problem hiding this comment.
Done! I've excluded it.
| - label: "`basic_models_library.yml`" | ||
| - label: "`antares_legacy_models.yml`" | ||
| - label: "`pypsa_models.yml`" | ||
| - label: "`andromede_models.yml`" |
There was a problem hiding this comment.
We will need to update this eachtime we add a library into GEMS repo ?
There was a problem hiding this comment.
Yes, but I will try to make it dynamic!
There was a problem hiding this comment.
Cannot make it dynamic, instead I've created text area.
| e2e-new-version: | ||
| name: E2E Tests against Antares v${{ needs.check-update.outputs.latest_version }} | ||
| runs-on: ubuntu-22.04 | ||
| needs: check-update | ||
| if: needs.check-update.outputs.update == 'true' | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v6 | ||
|
|
||
| - name: Set up Python 3.11 | ||
| uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: '3.11' | ||
| cache: 'pip' | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install -r requirements.txt | ||
|
|
||
| - name: Download new Antares release | ||
| run: | | ||
| VERSION="${{ needs.check-update.outputs.latest_version }}" | ||
| ARCHIVE="antares-${VERSION}-Ubuntu-22.04.tar.gz" | ||
| echo "Downloading Antares v${VERSION}..." | ||
| curl -L -f -o "${ARCHIVE}" \ | ||
| "https://github.com/AntaresSimulatorTeam/Antares_Simulator/releases/download/v${VERSION}/${ARCHIVE}" | ||
| echo "Download successful. File size: $(ls -lh "${ARCHIVE}" | awk '{print $5}')" | ||
|
|
||
| - name: Extract Antares binaries | ||
| run: | | ||
| VERSION="${{ needs.check-update.outputs.latest_version }}" | ||
| tar -xzf "antares-${VERSION}-Ubuntu-22.04.tar.gz" | ||
|
|
||
| - name: Point tests at new version | ||
| run: | | ||
| VERSION="${{ needs.check-update.outputs.latest_version }}" | ||
| sed -i "s/ANTARES_SIMULATOR_VERSION=.*/ANTARES_SIMULATOR_VERSION=${VERSION}/" versions/antares-simulator.txt | ||
|
|
||
| - name: Run end-to-end tests | ||
| id: run_tests | ||
| run: python -m pytest tests/e2e_tests -v | ||
| continue-on-error: true | ||
|
|
||
| - name: Upload test artifacts on failure | ||
| if: steps.run_tests.outcome == 'failure' | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: e2e-failures-antares-${{ needs.check-update.outputs.latest_version }} | ||
| path: | | ||
| tmp/ | ||
| **/*.log | ||
| retention-days: 7 | ||
|
|
||
| - name: Post results to issue | ||
| uses: actions/github-script@v9 | ||
| with: | ||
| script: | | ||
| const outcome = '${{ steps.run_tests.outcome }}'; | ||
| const version = '${{ needs.check-update.outputs.latest_version }}'; | ||
| const runUrl = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`; | ||
| const icon = outcome === 'success' ? '✅' : '❌'; | ||
| const status = outcome === 'success' ? 'passed' : 'failed'; | ||
|
|
||
| const body = [ | ||
| `## E2E Test Results — Antares v${version}`, | ||
| '', | ||
| `${icon} E2E tests **${status}** against Antares v${version}.`, | ||
| '', | ||
| `[View full run](${runUrl})`, | ||
| ].join('\n'); | ||
|
|
||
| await github.rest.issues.createComment({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| issue_number: Number('${{ needs.check-update.outputs.issue_number }}'), | ||
| body: body, | ||
| }); | ||
|
|
||
| - name: Cleanup | ||
| if: always() | ||
| run: | | ||
| VERSION="${{ needs.check-update.outputs.latest_version }}" | ||
| rm -f "antares-${VERSION}-Ubuntu-22.04.tar.gz" | ||
| rm -rf "antares-${VERSION}-Ubuntu-22.04" | ||
|
|
||
| - name: Fail job if tests failed | ||
| if: steps.run_tests.outcome == 'failure' | ||
| run: exit 1 |
There was a problem hiding this comment.
There is a lot in common with the e2e-test workflow, can we factorize all common steps in another yml and refer to it ? This will avoid double updates in the future or any inconsistencies that may lead to the e2e to pass with this CI job and not with the e2e test one
There was a problem hiding this comment.
Created a reusable workflow run-e2e-tests.yml. Both e2e-tests.yml and check-antares-update.yml now call it, E2E logic lives in one place. Please check it out.
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v6 | ||
|
|
||
| - name: Set up Python 3.11 | ||
| uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: '3.11' | ||
| cache: 'pip' | ||
|
|
||
| - name: Install dev dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install -r requirements-dev.txt |
There was a problem hiding this comment.
You may avoid reinstalling the whole environement twice
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v6 | ||
|
|
||
| - name: Set up Python 3.11 | ||
| uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: '3.11' | ||
| cache: 'pip' | ||
|
|
||
| - name: Install dev dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install -r requirements-dev.txt |
| antares_version = _read_antares_version(repo_root) | ||
| antares_root = repo_root / f"antares-{antares_version}-Ubuntu-22.04" |
There was a problem hiding this comment.
Duplicated code (with following lines)
There was a problem hiding this comment.
We will consider adding this info directly into the library files with @aoustry , this will avoid these additional files
Co-authored-by: tbittar <thomas.bittar@rte-france.com>
Co-authored-by: tbittar <thomas.bittar@rte-france.com>
Summary
This PR introduces CI/CD governance infrastructure for the GEMS repository: structured GitHub issue templates aligned with the formal process framework, automated Antares update detection with integrated E2E test validation, and a complete linting/type-checking pipeline.
Changes
1. GitHub Issue Templates (new)
Five dedicated issue templates — one per governance process — replacing the previous generic
process-change.ymltemplate. Each template includes a full Steps 1–10 checklist with process-specific deviations.doc-01.yml— Antares Simulator evolution impact on GEMS Language documentationdoc-02.yml— Internal documentation improvementlt-01.yml— Antares Simulator evolution impact on model libraries and taxonomieslibraries/), validation strategylt-02.yml— Internal library or taxonomy developmentlt-03.yml— New library or taxonomy2. Scheduled Antares Update Workflow (
check-antares-update.yml) — newDaily (06:00 UTC) automated check for a new stable Antares Simulator release.
check-updatejob — Fetches all GitHub tags, filters pre-releases (rc/alpha/beta/nightly), compares withversions/antares-simulator.txt; if a new version is found, fetches release notes from the GitHub API and creates a triage issue containing: version table, release notes, triage checklist (DOC-01 / LT-01 routing), and detailed task checklists (Validation, Compatibility, Documentation, Decision)e2e-new-versionjob — Calls the reusablerun-e2e-tests.ymlworkflow against the new Antares version (no repo change); exposestest_outcomeas outputpost-resultsjob — Runsif: always(); posts E2E test result (pass/fail + run link) as a comment on the triage issue3. Reusable E2E Workflow (
run-e2e-tests.yml) — newExtracts all E2E test steps into a reusable
workflow_callworkflow to avoid duplication betweene2e-tests.ymlandcheck-antares-update.yml.antares_version(required),artifact_name(optional, defaulte2e-test-failures)test_outcome(success or failure) — available to callers even when the job failscontinue-on-error: true), upload artifacts on failure, cleanup, fail if tests failed4. E2E Tests Workflow (
e2e-tests.yml) — updatedversions/antares-simulator.txt(was hardcoded as9.3.2) in aread-versionjobrun-e2e-tests.ymlworkflow — E2E logic no longer duplicatedactions/checkout@v6,actions/setup-python@v65. Lint and Format Workflow (
lint-and-format.yml) — newSingle job running all checks in sequence — avoids reinstalling the environment three times:
ruff check tests/andruff format --check tests/mypy(configuration driven bypyproject.toml)yamllint -c .yamllint.yml libraries/ resources/ .github/workflows/6. Tool Configuration (
pyproject.toml) — newteststests/directory; excludestests/e2e_tests/test_*andtests/e2e_tests/conftest.py(pytest fixture injection is not mypy-compatible); utility modulesenv.pyandutils.pyare fully type-checkedTesting
python -m pytest tests/ -v)ruff check tests/andruff format --check tests/pass with no violationsmypy(strict) passes ontests/e2e_tests/env.py,tests/e2e_tests/utils.py, and all unit testsyamllintpasses on all YAML files inlibraries/,resources/, and.github/workflows/Process Reference
doc-01.ymlcheck-antares-update.ymldoc-02.ymllt-01.ymlcheck-antares-update.ymllt-02.ymllt-03.ymlcheck-antares-update.yml(daily cron, auto-creates triage issue)