diff --git a/.github/workflows/CI_CD_actions.yml b/.github/workflows/CI_CD_actions.yml
index 08a2e8946..31f79bdd3 100644
--- a/.github/workflows/CI_CD_actions.yml
+++ b/.github/workflows/CI_CD_actions.yml
@@ -17,7 +17,7 @@ jobs:
- name: Check out repo
uses: actions/checkout@v4
- name: Set up Python
- uses: actions/setup-python@v4
+ uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Run pre-commit
@@ -33,7 +33,7 @@ jobs:
conda-channels: conda-forge
activate-conda: false
- name: Set up Python 3.10
- uses: actions/setup-python@v4
+ uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install dependencies
@@ -58,7 +58,7 @@ jobs:
conda-channels: conda-forge
activate-conda: false
- name: Set up Python 3.10
- uses: actions/setup-python@v4
+ uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install dependencies
@@ -81,7 +81,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
- uses: actions/setup-python@v4
+ uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install dependencies
@@ -106,7 +106,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
- uses: actions/setup-python@v4
+ uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
@@ -121,23 +121,21 @@ jobs:
python -m pytest --cov=./ --cov-report term --cov-report xml --cov-config pyproject.toml tests
- name: Codecov Upload
- uses: codecov/codecov-action@v3
+ uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
+ token: ${{ secrets.CODECOV_TOKEN }}
deploy:
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
needs: [test, docs, docs-notebooks]
- environment:
- name: pypi
- url: https://pypi.org/p/pyglotaran
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
- uses: actions/setup-python@v4
+ uses: actions/setup-python@v5
with:
python-version: "3.10"
diff --git a/.github/workflows/autoupdate-pre-commit-config.yml b/.github/workflows/autoupdate-pre-commit-config.yml
index b0f3ad4af..9779e11dd 100644
--- a/.github/workflows/autoupdate-pre-commit-config.yml
+++ b/.github/workflows/autoupdate-pre-commit-config.yml
@@ -14,8 +14,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Set up Python
- uses: actions/setup-python@v4
- - uses: actions/cache@v3
+ uses: actions/setup-python@v5
+ - uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: pre-commit-autoupdate
diff --git a/.github/workflows/doxygen.yml b/.github/workflows/doxygen.yml
index 72b6d43ec..2ed941155 100644
--- a/.github/workflows/doxygen.yml
+++ b/.github/workflows/doxygen.yml
@@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Set up Python 3.10
- uses: actions/setup-python@v4
+ uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install dependencies
diff --git a/.github/workflows/full_benchmark.yml b/.github/workflows/full_benchmark.yml
deleted file mode 100644
index 7781b82ad..000000000
--- a/.github/workflows/full_benchmark.yml
+++ /dev/null
@@ -1,84 +0,0 @@
-name: "Full Benchmarks"
-
-on:
- schedule:
- - cron: "0 5 * * 5"
- workflow_dispatch:
-
-jobs:
- run_benchmark:
- if: github.repository_owner == 'glotaran'
- name: "Run AVS"
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
- with:
- fetch-depth: 0
- ref: main
- - name: Set up Python 3.10
- uses: actions/setup-python@v4
- with:
- python-version: "3.10"
- - name: Install ASV
- run: |
- pip install asv virtualenv
- - name: Create machine-file
- shell: python
- run: |
- from pathlib import Path
- machine_file = Path("/home/runner/.asv-machine.json")
- machine_file_content = '''
- {
- "gh_action": {
- "arch": "x86_64",
- "cpu": "Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz",
- "num_cpu": "2",
- "machine": "gh_action",
- "os": "Linux 5.8.0-1033-azure",
- "ram": "7GB"
- },
- "version": 1
- }'''
- machine_file.write_text(machine_file_content)
- - name: Run benchmarks
- run: |
- pushd benchmark
- asv run 0d41d63ca3ca33bb0b70e25fe76ab0c16f6d2e1d..main --machine gh_action
- - name: Upload results
- uses: actions/upload-artifact@v3
- with:
- name: benchmark-results
- path: benchmark/.asv/results
-
- upload_results:
- name: "Upload Results"
- needs: [run_benchmark]
- runs-on: ubuntu-latest
- steps:
- - name: Checkout benchmark result repo
- uses: actions/checkout@v4
- with:
- persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
- fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
- repository: "glotaran/pyglotaran-benchmarks"
- ref: main
-
- - name: Download result artifact
- uses: actions/download-artifact@v3
- with:
- name: benchmark-results
- path: results
-
- - name: Commit results
- run: |
- git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
- git config user.name 'github-actions[bot]'
- git add results
- git commit -m "⬆️ Update full benchmark"
-
- - name: Push result repo
- uses: ad-m/github-push-action@v0.6.0
- with:
- github_token: ${{ secrets.BENCHMARK_PUSH_TOKEN }}
- repository: "glotaran/pyglotaran-benchmarks"
- branch: main
diff --git a/.github/workflows/pr_benchmark.yml b/.github/workflows/pr_benchmark.yml
deleted file mode 100644
index 97b905a4b..000000000
--- a/.github/workflows/pr_benchmark.yml
+++ /dev/null
@@ -1,119 +0,0 @@
-name: "PR Benchmarks"
-
-on:
- pull_request:
-
-jobs:
- run_benchmark:
- name: "Run AVS"
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
- with:
- fetch-depth: 0
- ref: ${{ github.event.pull_request.head.sha }}
- - name: Set up Python 3.10
- uses: actions/setup-python@v4
- with:
- python-version: "3.10"
- - name: Install ASV
- run: |
- pip install 'asv!=0.5' virtualenv packaging
-
- - name: show home file
- run: |
- ls -lah ~
- realpath ~
- - name: Create machine-file
- shell: python
- run: |
- from pathlib import Path
- machine_file = Path("/home/runner/.asv-machine.json")
- machine_file_content = '''
- {
- "gh_action": {
- "arch": "x86_64",
- "cpu": "Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz",
- "num_cpu": "2",
- "machine": "gh_action",
- "os": "Linux 5.8.0-1033-azure",
- "ram": "7GB"
- },
- "version": 1
- }'''
- machine_file.write_text(machine_file_content)
-
- - name: Run PR compare benchmarks
- id: benchmark_run
- run: |
- git remote add upstream https://github.com/glotaran/pyglotaran
- git fetch upstream
- pushd benchmark
- last_tag=$(git describe --tags "$(git rev-list --tags --max-count=1)")
- asv run "$last_tag^..$last_tag" --machine gh_action
- asv run upstream/main^..upstream/main --machine gh_action
- asv run HEAD^..HEAD --machine gh_action
- asv publish
- echo "last_tag=$last_tag" >> "$GITHUB_OUTPUT"
-
- - name: Checkout benchmark result repo
- uses: actions/checkout@v4
- with:
- repository: "glotaran/pyglotaran-benchmarks"
- ref: main
- path: benchmark-repo
- - name: Copy benchmark workflows to html folder
- run: |
- cp -r benchmark-repo/.github benchmark/.asv/html
- ls -lah benchmark/.asv/html
-
- - name: Create PR comment body
- shell: python
- env:
- PR_NR: ${{github.event.number}}
- run: |
- import os
- from pathlib import Path
- import subprocess
-
- pr_nr = os.environ.get("PR_NR")
- diff_release_main = subprocess.run(
- ["asv", "--config=benchmark/asv.conf.json", "compare", "${{steps.benchmark_run.outputs.last_tag}}", "upstream/main"],
- capture_output=True,
- )
- diff_main_PR = subprocess.run(
- ["asv", "--config=benchmark/asv.conf.json", "compare", "upstream/main", "HEAD"],
- capture_output=True,
- )
- comment = f"""\
- Benchmark is done. Checkout the [benchmark result page](https://glotaran.github.io/pyglotaran-benchmarks/prs/pr-{pr_nr}).
- Benchmark differences below 5% might be due to CI noise.
-
-
- Benchmark diff ${{steps.benchmark_run.outputs.last_tag}} vs. main
-
-
- ```
- {diff_release_main.stdout.decode()}
- ```
-
-
-
-
- Benchmark diff main vs. PR
-
-
- ```
- {diff_main_PR.stdout.decode()}
- ```
-
- """
-
- Path("benchmark/.asv/html/pr-diff-comment.txt").write_text(comment)
- Path("benchmark/.asv/html/origin_pr_nr.txt").write_text(pr_nr)
-
- - name: Upload PR html results
- uses: actions/upload-artifact@v3
- with:
- name: benchmark-pr-html
- path: benchmark/.asv/html
diff --git a/.github/workflows/pr_benchmark_reaction.yml b/.github/workflows/pr_benchmark_reaction.yml
deleted file mode 100644
index 37d64d290..000000000
--- a/.github/workflows/pr_benchmark_reaction.yml
+++ /dev/null
@@ -1,97 +0,0 @@
-name: PR Benchmark reaction
-
-# read-write repo token
-# access to secrets
-on:
- workflow_run:
- workflows: ["PR Benchmarks"]
- types:
- - completed
-
-jobs:
- upload:
- name: Comment and upload
- runs-on: ubuntu-latest
- if: >
- github.event.workflow_run.event == 'pull_request' &&
- github.event.workflow_run.conclusion == 'success'
- steps:
- - name: Download artifact
- uses: actions/github-script@v6
- with:
- script: |
- var artifacts = await github.rest.actions.listWorkflowRunArtifacts({
- owner: context.repo.owner,
- repo: context.repo.repo,
- run_id: ${{github.event.workflow_run.id }},
- });
- var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
- return artifact.name == "benchmark-pr-html"
- })[0];
- var download = await github.rest.actions.downloadArtifact({
- owner: context.repo.owner,
- repo: context.repo.repo,
- artifact_id: matchArtifact.id,
- archive_format: 'zip',
- });
- var fs = require('fs');
- fs.writeFileSync('${{github.workspace}}/benchmark-pr-html.zip', Buffer.from(download.data));
-
- - name: Unzip PR Benchmark results
- run: |
- unzip benchmark-pr-html.zip
- rm benchmark-pr-html.zip
-
- - name: Show tree
- run: tree -a .
-
- - name: Set PR comment
- id: bench_diff
- shell: python
- run: |
- import os
- from pathlib import Path
-
- with open(os.getenv("GITHUB_OUTPUT"), "a", encoding="utf8") as f:
- comment_file_path = Path("pr-diff-comment.txt")
- f.write(f"comment< None: