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

Bump versions of GitHub Actions #1499

Merged
merged 4 commits into from
Nov 26, 2024
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
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---

name: Python build and test

"on":
Expand Down Expand Up @@ -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 }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---

# yamllint disable rule:line-length

name: Create/Update Tag
Expand All @@ -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 "[email protected]"
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 "[email protected]"
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: |
Expand All @@ -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:
Expand All @@ -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 }}
Expand All @@ -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 }}
Expand Down
19 changes: 5 additions & 14 deletions .github/workflows/pages.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
---


name: "Pages"

concurrency:
Expand All @@ -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:
Expand All @@ -31,9 +26,8 @@ jobs:
- "6379:6379/tcp"

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
Expand All @@ -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"
with:
environment-file: "conda-environment.yml"
micromamba-version: 1.5.10-0
Expand All @@ -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"
with:
path: "docs/build/html"

"pages-deploy":

if: "github.ref_name == github.event.repository.default_branch"

environment:
Expand All @@ -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"

- name: "Deploy to GitHub Pages"
id: "deployment"
uses: "actions/deploy-pages@v2" # tested with 2.0.4

uses: "actions/deploy-pages@v4"

... # EOF
21 changes: 10 additions & 11 deletions .github/workflows/ui.yml → .github/workflows/ui.yaml
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -21,18 +20,18 @@ 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
cache-environment: true
post-cleanup: "all"

- name: Cache UI dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/setup-pnpm/node_modules/.bin/store
Expand All @@ -55,18 +54,18 @@ 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
cache-environment: true
post-cleanup: "all"

- name: Cache UI dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/setup-pnpm/node_modules/.bin/store
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
8 changes: 5 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
}
}