Skip to content

Commit 9c49cbe

Browse files
authored
Merge pull request #225 from linkml/issue-2720-update-gh-actions-workflows
Update GitHub Actions workflows (sync with other repos in org)
2 parents a3832a5 + ba153db commit 9c49cbe

File tree

5 files changed

+42
-59
lines changed

5 files changed

+42
-59
lines changed

.github/workflows/build-publish-documentation.yaml

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
push:
66
branches:
77
- main
8+
pull_request:
9+
branches:
10+
- main
811

912
jobs:
1013
github-pages:
@@ -18,39 +21,29 @@ jobs:
1821
# check-out repo and set-up python
1922
#----------------------------------------------
2023
- name: Check out repository
21-
uses: actions/checkout@v3
24+
uses: actions/checkout@v4.2.2
2225
with:
2326
fetch-depth: 0 # fetch all commits/branches so that mike works
2427

25-
- name: Setup Python 3.9
26-
uses: actions/setup-python@v4
27-
with:
28-
python-version: 3.9
29-
3028
#----------------------------------------------
3129
# install & configure poetry
3230
#----------------------------------------------
3331
- name: Install Poetry
34-
uses: snok/[email protected]
35-
with:
36-
virtualenvs-create: true
37-
virtualenvs-in-project: true
32+
run: |
33+
pipx install poetry
34+
pipx inject poetry poetry-dynamic-versioning
3835
39-
#----------------------------------------------
40-
# load cached venv if cache exists
41-
#----------------------------------------------
42-
- name: Load cached venv
43-
id: cached-poetry-dependencies
44-
uses: actions/cache@v3
36+
- name: Setup Python
37+
uses: actions/[email protected]
38+
id: setup-python
4539
with:
46-
path: .venv
47-
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
40+
python-version: '3.10'
41+
cache: 'poetry'
4842

4943
#----------------------------------------------
50-
# install dependencies if cache does not exist
44+
# install dependencies
5145
#----------------------------------------------
5246
- name: Install dependencies
53-
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
5447
run: poetry install --no-interaction --no-root
5548

5649
- name: Configure git user
@@ -72,9 +65,11 @@ jobs:
7265
# generate HTML from markdown and put into dev version
7366
poetry run mike deploy dev
7467
68+
# ensure the main branch is available locally
69+
git fetch origin main
7570
# switch to gh-pages branch, copy over the latest 404.html from main
7671
git checkout --force gh-pages
77-
git checkout --force main -- 404.html
72+
git checkout --force origin/main -- 404.html
7873
git commit -m "Add 404.html to root" || echo "No changes to 404.html to commit"
7974
8075
# push changes to gh-page branch

.github/workflows/codespell.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616

1717
steps:
1818
- name: Checkout
19-
uses: actions/checkout@v3
19+
uses: actions/checkout@v4.2.2
2020

2121
- name: Codespell
22-
uses: codespell-project/actions-codespell@v2
22+
uses: codespell-project/actions-codespell@v2.1

.github/workflows/main.yaml

Lines changed: 15 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,59 +6,48 @@ name: Build and test linkml-model
66

77
on:
88
pull_request:
9-
branches: [ main ]
10-
types: [ opened, synchronize, reopened ]
9+
branches: [main]
10+
types: [opened, synchronize, reopened]
1111

1212
jobs:
1313
test:
14-
1514
runs-on: ubuntu-latest
15+
1616
strategy:
1717
matrix:
1818
python-version: ["3.9", "3.10"]
1919

2020
steps:
21-
2221
#----------------------------------------------
2322
# check-out repo and set-up python
2423
#----------------------------------------------
2524
- name: Check out repository
26-
uses: actions/checkout@v3
27-
28-
- name: Set up Python ${{ matrix.python-version }}
29-
uses: actions/setup-python@v4
25+
uses: actions/[email protected]
3026
with:
31-
python-version: ${{ matrix.python-version }}
27+
fetch-depth: 0
3228

3329
#----------------------------------------------
3430
# install & configure poetry
3531
#----------------------------------------------
3632
- name: Install Poetry
37-
uses: snok/[email protected]
38-
with:
39-
virtualenvs-create: true
40-
virtualenvs-in-project: true
33+
run: |
34+
pipx install poetry
35+
pipx inject poetry poetry-dynamic-versioning
4136
42-
#----------------------------------------------
43-
# load cached venv if cache exists
44-
#----------------------------------------------
45-
- name: Load cached venv
46-
id: cached-poetry-dependencies
47-
uses: actions/cache@v3
37+
- name: Set up Python ${{ matrix.python-version }}
38+
uses: actions/[email protected]
4839
with:
49-
path: .venv
50-
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
40+
python-version: ${{ matrix.python-version }}
41+
cache: "poetry"
5142

5243
#----------------------------------------------
53-
# install dependencies if cache does not exist
44+
# install dependencies
5445
#----------------------------------------------
5546
- name: Install dependencies
56-
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
57-
run: poetry install --no-interaction --no-root
47+
run: poetry install --no-interaction --all-extras --no-root
5848

5949
#----------------------------------------------
60-
# run test suite
50+
# run test suite
6151
#----------------------------------------------
6252
- name: Run tests
6353
run: make test
64-

.github/workflows/release.yaml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,19 @@ jobs:
1414

1515
steps:
1616
- name: Checkout repo
17-
uses: actions/checkout@v3
17+
uses: actions/checkout@v4.2.2
1818
with:
1919
fetch-depth: 0 # fetch all commits/branches so that mike works
2020

2121
- name: Set up Python
22-
uses: actions/setup-python@v4
22+
uses: actions/setup-python@v5.6.0
2323
with:
24-
python-version: 3.9
24+
python-version: 3.10
2525

2626
- name: Install Poetry
27-
uses: snok/[email protected]
28-
with:
29-
virtualenvs-create: true
30-
virtualenvs-in-project: true
27+
run: |
28+
pipx install poetry
29+
pipx inject poetry poetry-dynamic-versioning
3130
3231
- name: Install dependencies
3332
run: poetry install --no-interaction
@@ -39,14 +38,14 @@ jobs:
3938
4039
- name: Publish distribution to PyPI
4140
if: github.repository == 'linkml/linkml-model'
42-
uses: pypa/gh-action-pypi-publish@v1.2.2
41+
uses: pypa/gh-action-pypi-publish@v1.12.4
4342
with:
4443
user: __token__
4544
password: ${{ secrets.pypi_password }}
4645

4746
- name: Parse version from tag
4847
id: version
49-
uses: release-kit/semver@v2
48+
uses: release-kit/semver@v2.0.7
5049

5150
- name: Configure git user
5251
run: |

.github/workflows/validate-yaml-syntax.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Check out repository
14-
uses: actions/checkout@v3
14+
uses: actions/checkout@v4.2.2
1515

1616
- name: Validate YAML file
1717
run: yamllint -c .yamllint-config linkml_model/model/schema/*.yaml

0 commit comments

Comments
 (0)