Skip to content

Commit 0bd5781

Browse files
committed
build: Update to latest profile template
1 parent 61bedba commit 0bd5781

File tree

7 files changed

+30
-102
lines changed

7 files changed

+30
-102
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -2,46 +2,15 @@ name: CI
22
on: [push, pull_request]
33
jobs:
44
build:
5-
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
6-
runs-on: ubuntu-latest
7-
steps:
8-
- uses: actions/checkout@v4
9-
with:
10-
submodules: true
11-
- uses: actions/setup-python@v5
12-
with:
13-
python-version: '3.10'
14-
cache: pip
15-
cache-dependency-path: '**/requirements*.txt'
16-
# Don't install editable projects in the current working directory.
17-
# https://pip.pypa.io/en/latest/reference/pip_install/#install-src
18-
- run: pip install --src $GITHUB_WORKSPACE/../src -r requirements.txt
19-
- if: github.repository == 'open-contracting/standard_profile_template'
20-
run: make update extract
21-
- run: make
22-
# Disable linkcheck as it is too slow for development.
23-
# - run: |
24-
# make linkcheck
25-
# rm -f output.json output.txt
5+
uses: open-contracting/.github/.github/workflows/ci-profile.yml@main
6+
secrets:
7+
private-key: ${{ secrets.PRIVATE_KEY }}
8+
elasticsearch-password: ${{ secrets.ELASTICSEARCH_PASSWORD }}
9+
with:
10+
path-prefix: ''
11+
version: '1.1'
12+
production-refs: '["refs/heads/1.0", "refs/heads/1.1"]'
13+
# Linkcheck is slow for development.
14+
linkcheck: false
2615
# "ResourceWarning: unclosed file <_io.BufferedWriter name='/dev/null'>"
27-
- run: pytest -W error -W ignore::ResourceWarning
28-
# Deploy the built documentation to the staging directory.
29-
- if: github.event_name == 'push'
30-
uses: shimataro/ssh-key-action@v2
31-
with:
32-
key: ${{ secrets.PRIVATE_KEY }}
33-
known_hosts: standard.open-contracting.org ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGveFGTJ9yyObNGDUCUyzyFkm6Kzh3YqIt1qB7B/KU6E
34-
- if: github.event_name == 'push'
35-
uses: bcomnes/netrc-creds@v3
36-
with:
37-
machine: standard.open-contracting.org
38-
login: manage
39-
password: ${{ secrets.ELASTICSEARCH_PASSWORD }}
40-
- if: github.event_name == 'push' && success() && github.repository != 'open-contracting/standard_profile_template'
41-
env:
42-
PATH_PREFIX: ""
43-
PRODUCTION: ${{ startsWith(github.ref, 'refs/tags') || github.ref == 'refs/heads/latest' || github.ref == 'refs/heads/1.0' || github.ref == 'refs/heads/1.1' }}
44-
RELEASE: ${{ startsWith(github.ref, 'refs/tags') }}
45-
VERSION: "1.1"
46-
shell: bash
47-
run: curl -sS https://raw.githubusercontent.com/open-contracting/deploy/main/deploy-docs.sh | bash -
16+
pytest-options: -W ignore::ResourceWarning

.github/workflows/js.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
name: Lint JavaScript
22
on: [push, pull_request]
33
jobs:
4-
build:
5-
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
6-
runs-on: ubuntu-latest
7-
steps:
8-
- uses: actions/checkout@v4
9-
- uses: biomejs/setup-biome@v2
10-
- run: biome ci --indent-style=space --line-width=119 docs/_static/script.js
4+
lint:
5+
uses: open-contracting/.github/.github/workflows/js.yml@main
6+
with:
7+
filenames: docs/_static/script.js

.github/workflows/lint.yml

Lines changed: 6 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,9 @@
11
name: Lint
22
on: [push, pull_request]
3-
env:
4-
BASEDIR: https://raw.githubusercontent.com/open-contracting/standard-maintenance-scripts/main
53
jobs:
6-
build:
7-
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
8-
runs-on: ubuntu-latest
9-
env:
10-
PAT: ${{ secrets.PAT }}
11-
steps:
12-
- uses: actions/checkout@v4
13-
with:
14-
token: ${{ secrets.PAT || github.token }}
15-
- uses: actions/setup-python@v5
16-
with:
17-
python-version: '3.10'
18-
cache: pip
19-
cache-dependency-path: '**/requirements*.txt'
20-
- id: changed-files
21-
uses: tj-actions/changed-files@v45
22-
- uses: pre-commit/action@v3.0.1
23-
continue-on-error: true
24-
with:
25-
extra_args: pip-compile --files ${{ steps.changed-files.outputs.all_changed_files }}
26-
- if: ${{ env.PAT }}
27-
uses: stefanzweifel/git-auto-commit-action@v5
28-
with:
29-
commit_message: '[github-actions] pre-commit autoupdate'
30-
- shell: bash
31-
run: curl -s -S --retry 3 $BASEDIR/tests/install.sh | bash -
32-
- shell: bash
33-
run: curl -s -S --retry 3 $BASEDIR/tests/script.sh | bash -
4+
lint:
5+
uses: open-contracting/.github/.github/workflows/lint.yml@main
6+
permissions:
7+
contents: write
8+
with:
9+
python-version: '3.10'

.github/workflows/shell.yml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
11
name: Lint Shell
22
on: [push, pull_request]
33
jobs:
4-
build:
5-
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
6-
runs-on: ubuntu-latest
7-
steps:
8-
- uses: actions/checkout@v4
9-
- run: |
10-
sudo apt update
11-
sudo apt install devscripts shellcheck shfmt
12-
- run: checkbashisms $(shfmt -f .)
13-
- run: shellcheck $(shfmt -f .)
14-
- run: shfmt -d -i 4 -sr $(shfmt -f .)
4+
lint:
5+
uses: open-contracting/.github/.github/workflows/shell.yml@main

.github/workflows/spellcheck.yml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
name: Spell-check
22
on: [push, pull_request]
33
jobs:
4-
build:
5-
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
6-
runs-on: ubuntu-latest
7-
steps:
8-
- uses: actions/checkout@v4
9-
- uses: actions/setup-python@v5
10-
with:
11-
python-version: '3.10'
12-
- run: pip install codespell
13-
- run: codespell -S .git,docson,locale,examples,country.csv,currency.csv,language.csv,mediaType.csv -L fo,sme,zar,SME .
4+
lint:
5+
uses: open-contracting/.github/.github/workflows/spellcheck.yml@main
6+
with:
7+
ignore: fo,sme,zar
8+
skip: docson,locale,examples,country.csv,currency.csv,language.csv,mediaType.csv

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
"license_url": f"{repository_url}/blob/HEAD/LICENSE",
105105
"repository_url": repository_url,
106106
}
107-
html_short_title = f"{html_theme_options["short_project"]} v{release}"
107+
html_short_title = f"{html_theme_options['short_project']} v{release}"
108108

109109
# List the extension identifiers and versions that should be part of this specification. The extensions must be in
110110
# the extension registry: https://github.com/open-contracting/extension_registry/blob/main/extension_versions.csv

script/diff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set -u
55

66
curl -sS https://raw.githubusercontent.com/open-contracting/standard_profile_template/latest/docs/conf.py | diff -u - docs/conf.py
77

8-
for f in .github/workflows/ci.yml .github/workflows/js.yml .github/workflows/spellcheck.yml include/config.mk; do
8+
for f in .github/workflows/ci.yml .github/workflows/spellcheck.yml include/config.mk; do
99
curl -sS https://raw.githubusercontent.com/open-contracting/standard_profile_template/latest/$f | diff -u - $f
1010
done
1111

0 commit comments

Comments
 (0)