From 6294fe99f3b40d5223526ed01db6dfd85b4f3a61 Mon Sep 17 00:00:00 2001 From: Axel Bocciarelli Date: Mon, 25 Nov 2024 14:59:45 +0100 Subject: [PATCH 1/4] Bump versions of GitHub Actions --- .github/workflows/build_and_test.yml | 7 +++--- .github/workflows/bump_version_and_tag.yml | 29 +++++++++++----------- .github/workflows/pages.yaml | 17 +++---------- .github/workflows/ui.yml | 21 ++++++++-------- 4 files changed, 31 insertions(+), 43 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 46504a7d6..74730f2d6 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -1,5 +1,4 @@ --- - name: Python build and test "on": @@ -35,16 +34,16 @@ jobs: - 6379:6379 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} # Pin micromamba version because of following issue: # https://github.com/mamba-org/setup-micromamba/issues/225 - name: Set up Conda environment - uses: mamba-org/setup-micromamba@v1 + uses: mamba-org/setup-micromamba@v2 with: create-args: >- python=${{ matrix.python-version }} diff --git a/.github/workflows/bump_version_and_tag.yml b/.github/workflows/bump_version_and_tag.yml index f7e3050f0..32416ee8d 100644 --- a/.github/workflows/bump_version_and_tag.yml +++ b/.github/workflows/bump_version_and_tag.yml @@ -1,5 +1,4 @@ --- - # yamllint disable rule:line-length name: Create/Update Tag @@ -13,25 +12,25 @@ jobs: create-version-tag: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: token: ${{ secrets.CI_TOKEN }} - name: Set up Python 3.10 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: "3.10" - name: Update version id: update-version run: | - pip install --upgrade pip - pip install poetry - poetry version minor - git config --global user.email "oscarsso@esrf.fr" - git config --global user.name "Marcus Oskarsson" - git add -A - git commit -m "[skip ci] Bumped minor version" - git push -f - poetry build + pip install --upgrade pip + pip install poetry + poetry version minor + git config --global user.email "oscarsso@esrf.fr" + git config --global user.name "Marcus Oskarsson" + git add -A + git commit -m "[skip ci] Bumped minor version" + git push -f + poetry build - name: Publish package to PyPI id: publish-pacakge run: | @@ -45,7 +44,7 @@ jobs: echo ::set-output name=tag_name::v$(python -c 'import toml; print(toml.load("./pyproject.toml")["tool"]["poetry"]["version"])') - name: Check tag exists id: check-tag-exists - uses: actions/github-script@v6 + uses: actions/github-script@v7 env: TAG: ${{ steps.set-tag.outputs.tag_name }} with: @@ -70,7 +69,7 @@ jobs: core.setOutput('exists', exists); - name: Update tag - uses: actions/github-script@v6 + uses: actions/github-script@v7 if: steps.check-tag-exists.outputs.exists == 'true' env: TAG: ${{ steps.set-tag.outputs.tag_name }} @@ -85,7 +84,7 @@ jobs: }) - name: Create tag - uses: actions/github-script@v6 + uses: actions/github-script@v7 if: steps.check-tag-exists.outputs.exists != 'true' env: TAG: ${{ steps.set-tag.outputs.tag_name }} diff --git a/.github/workflows/pages.yaml b/.github/workflows/pages.yaml index f3fdfdbc4..714f08623 100644 --- a/.github/workflows/pages.yaml +++ b/.github/workflows/pages.yaml @@ -1,6 +1,4 @@ --- - - name: "Pages" concurrency: @@ -11,13 +9,10 @@ concurrency: push: null jobs: - "pages-build": - runs-on: "ubuntu-22.04" services: - # The Redis server is necessary to run the app, # which is necessary to get the Flask routes with `autoflask` directives redis: @@ -31,7 +26,6 @@ jobs: - "6379:6379/tcp" steps: - - name: "Checkout" uses: "actions/checkout@v4" # tested with v4.0.0 with: @@ -43,7 +37,7 @@ jobs: # Pin micromamba version because of following issue: # https://github.com/mamba-org/setup-micromamba/issues/225 - name: "Setup conda environment with micromamba" - uses: "mamba-org/setup-micromamba@v1" # tested with v1.4.4 + uses: "mamba-org/setup-micromamba@v2" # tested with v2.0.1 with: environment-file: "conda-environment.yml" micromamba-version: 1.5.10-0 @@ -58,12 +52,11 @@ jobs: # This could potentially be run only when we intent to deploy... # ...but it can be useful to have the artifact for debugging # if: "github.ref_name == github.event.repository.default_branch" - uses: "actions/upload-pages-artifact@v2" # tested with v2.0.0 + uses: "actions/upload-pages-artifact@v3" # tested with v3.0.1 with: path: "docs/build/html" "pages-deploy": - if: "github.ref_name == github.event.repository.default_branch" environment: @@ -80,13 +73,11 @@ jobs: runs-on: "ubuntu-22.04" steps: - - name: "Setup GitHub Pages" - uses: "actions/configure-pages@v3" # tested with v3.0.6 + uses: "actions/configure-pages@v5" # tested with v5.0.0 - name: "Deploy to GitHub Pages" id: "deployment" - uses: "actions/deploy-pages@v2" # tested with 2.0.4 - + uses: "actions/deploy-pages@v4" # tested with 4.0.5 ... # EOF diff --git a/.github/workflows/ui.yml b/.github/workflows/ui.yml index fbf34c693..8af8a382c 100644 --- a/.github/workflows/ui.yml +++ b/.github/workflows/ui.yml @@ -1,7 +1,6 @@ --- # yamllint disable rule:line-length - # Pin micromamba version to `1.5.10-0` because of following issue: # https://github.com/mamba-org/setup-micromamba/issues/225 @@ -21,10 +20,10 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Conda environment - uses: mamba-org/setup-micromamba@v1 + uses: mamba-org/setup-micromamba@v2 with: micromamba-version: 1.5.10-0 environment-file: conda-environment.yml @@ -32,7 +31,7 @@ jobs: post-cleanup: "all" - name: Cache UI dependencies - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: | ~/setup-pnpm/node_modules/.bin/store @@ -55,10 +54,10 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Conda environment - uses: mamba-org/setup-micromamba@v1 + uses: mamba-org/setup-micromamba@v2 with: micromamba-version: 1.5.10-0 environment-file: conda-environment.yml @@ -66,7 +65,7 @@ jobs: post-cleanup: "all" - name: Cache UI dependencies - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: | ~/setup-pnpm/node_modules/.bin/store @@ -106,10 +105,10 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Conda environment - uses: mamba-org/setup-micromamba@v1 + uses: mamba-org/setup-micromamba@v2 with: micromamba-version: 1.5.10-0 environment-file: conda-environment.yml @@ -120,7 +119,7 @@ jobs: run: "${MAMBA_EXE} run --name mxcubeweb poetry install --only main" - name: Cache UI dependencies - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: | ~/setup-pnpm/node_modules/.bin/store @@ -144,7 +143,7 @@ jobs: env: CYPRESS_BASE_URL: http://127.0.0.1:8081 - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: failure() with: name: debug From 02537b6ecafb7fa38ff600e9dde021c066bc4742 Mon Sep 17 00:00:00 2001 From: Axel Bocciarelli Date: Mon, 25 Nov 2024 16:48:43 +0100 Subject: [PATCH 2/4] Use `yaml` extension for GH workflows --- .github/workflows/{build_and_test.yml => build_and_test.yaml} | 0 .../{bump_version_and_tag.yml => bump_version_and_tag.yaml} | 0 .github/workflows/{ui.yml => ui.yaml} | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{build_and_test.yml => build_and_test.yaml} (100%) rename .github/workflows/{bump_version_and_tag.yml => bump_version_and_tag.yaml} (100%) rename .github/workflows/{ui.yml => ui.yaml} (100%) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yaml similarity index 100% rename from .github/workflows/build_and_test.yml rename to .github/workflows/build_and_test.yaml diff --git a/.github/workflows/bump_version_and_tag.yml b/.github/workflows/bump_version_and_tag.yaml similarity index 100% rename from .github/workflows/bump_version_and_tag.yml rename to .github/workflows/bump_version_and_tag.yaml diff --git a/.github/workflows/ui.yml b/.github/workflows/ui.yaml similarity index 100% rename from .github/workflows/ui.yml rename to .github/workflows/ui.yaml From 530e219c714126d3b085c39e936a1de328ca98c2 Mon Sep 17 00:00:00 2001 From: Axel Bocciarelli Date: Mon, 25 Nov 2024 16:48:53 +0100 Subject: [PATCH 3/4] Disable auto-save for GH workflows --- .vscode/settings.json | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 44ec13a49..469dd758d 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -10,11 +10,13 @@ }, "eslint.workingDirectories": ["./ui"], + "[python]": { "editor.defaultFormatter": "ms-python.black-formatter" - } - "[yaml]": { + }, + + "[yaml][github-actions-workflow]": { "editor.defaultFormatter": "esbenp.prettier-vscode", "editor.formatOnSave": false - }, + } } From 5f023a214a99848523f00b23708f782882828b8e Mon Sep 17 00:00:00 2001 From: Axel Bocciarelli Date: Mon, 25 Nov 2024 16:51:28 +0100 Subject: [PATCH 4/4] Remove GH action version comments --- .github/workflows/pages.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pages.yaml b/.github/workflows/pages.yaml index 714f08623..ffcaeba25 100644 --- a/.github/workflows/pages.yaml +++ b/.github/workflows/pages.yaml @@ -27,7 +27,7 @@ jobs: steps: - name: "Checkout" - uses: "actions/checkout@v4" # tested with v4.0.0 + uses: "actions/checkout@v4" with: # With shallow clone the "Last updated" timestamp can not get computed # See "Caveats" at https://pypi.org/project/sphinx-last-updated-by-git @@ -37,7 +37,7 @@ jobs: # Pin micromamba version because of following issue: # https://github.com/mamba-org/setup-micromamba/issues/225 - name: "Setup conda environment with micromamba" - uses: "mamba-org/setup-micromamba@v2" # tested with v2.0.1 + uses: "mamba-org/setup-micromamba@v2" with: environment-file: "conda-environment.yml" micromamba-version: 1.5.10-0 @@ -52,7 +52,7 @@ jobs: # This could potentially be run only when we intent to deploy... # ...but it can be useful to have the artifact for debugging # if: "github.ref_name == github.event.repository.default_branch" - uses: "actions/upload-pages-artifact@v3" # tested with v3.0.1 + uses: "actions/upload-pages-artifact@v3" with: path: "docs/build/html" @@ -74,10 +74,10 @@ jobs: steps: - name: "Setup GitHub Pages" - uses: "actions/configure-pages@v5" # tested with v5.0.0 + uses: "actions/configure-pages@v5" - name: "Deploy to GitHub Pages" id: "deployment" - uses: "actions/deploy-pages@v4" # tested with 4.0.5 + uses: "actions/deploy-pages@v4" ... # EOF