Skip to content

Commit

Permalink
build: Update to latest profile template
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmckinney committed Nov 27, 2024
1 parent ac9fc78 commit ccc943e
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 110 deletions.
49 changes: 8 additions & 41 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,44 +2,11 @@ name: CI
on: [push, pull_request]
jobs:
build:
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: pip
cache-dependency-path: '**/requirements*.txt'
# Don't install editable projects in the current working directory.
# https://pip.pypa.io/en/latest/reference/pip_install/#install-src
- run: pip install --src $GITHUB_WORKSPACE/../src -r requirements.txt
- if: github.repository == 'open-contracting/standard_profile_template'
run: make update extract
- run: make
- run: |
make linkcheck
find . \( -name output.json -o -name output.txt \) -exec rm -r "{}" \;
- run: pytest -W error
# Deploy the built documentation to the staging directory.
- if: github.event_name == 'push'
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.PRIVATE_KEY }}
known_hosts: standard.open-contracting.org ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGveFGTJ9yyObNGDUCUyzyFkm6Kzh3YqIt1qB7B/KU6E
- if: github.event_name == 'push'
uses: bcomnes/netrc-creds@v3
with:
machine: standard.open-contracting.org
login: manage
password: ${{ secrets.ELASTICSEARCH_PASSWORD }}
- if: github.event_name == 'push' && success() && github.repository != 'open-contracting/standard_profile_template'
env:
PATH_PREFIX: profiles/ppp/
PRODUCTION: ${{ startsWith(github.ref, 'refs/tags') || github.ref == 'refs/heads/latest' || github.ref == 'refs/heads/1.0' }}
RELEASE: ${{ startsWith(github.ref, 'refs/tags') }}
VERSION: "1.0"
shell: bash
run: curl -sS https://raw.githubusercontent.com/open-contracting/deploy/main/deploy-docs.sh | bash -
uses: open-contracting/.github/.github/workflows/ci-profile.yml@main
secrets:
private-key: ${{ secrets.PRIVATE_KEY }}
elasticsearch-password: ${{ secrets.ELASTICSEARCH_PASSWORD }}
with:
path-prefix: profiles/ppp/
version: '1.0'
production-refs: '["refs/heads/1.0"]'
11 changes: 4 additions & 7 deletions .github/workflows/js.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
name: Lint JavaScript
on: [push, pull_request]
jobs:
build:
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: biomejs/setup-biome@v2
- run: biome ci --indent-style=space --line-width=119 docs/_static/show-shower.js
lint:
uses: open-contracting/.github/.github/workflows/js.yml@main
with:
filenames: docs/_static/show-shower.js
36 changes: 6 additions & 30 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,9 @@
name: Lint
on: [push, pull_request]
env:
BASEDIR: https://raw.githubusercontent.com/open-contracting/standard-maintenance-scripts/main
jobs:
build:
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-latest
env:
PAT: ${{ secrets.PAT }}
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.PAT || github.token }}
- uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: pip
cache-dependency-path: '**/requirements*.txt'
- id: changed-files
uses: tj-actions/changed-files@v45
- uses: pre-commit/[email protected]
continue-on-error: true
with:
extra_args: pip-compile --files ${{ steps.changed-files.outputs.all_changed_files }}
- if: ${{ env.PAT }}
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: '[github-actions] pre-commit autoupdate'
- shell: bash
run: curl -s -S --retry 3 $BASEDIR/tests/install.sh | bash -
- shell: bash
run: curl -s -S --retry 3 $BASEDIR/tests/script.sh | bash -
lint:
uses: open-contracting/.github/.github/workflows/lint.yml@main
permissions:
contents: write
with:
python-version: '3.10'
13 changes: 2 additions & 11 deletions .github/workflows/shell.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
name: Lint Shell
on: [push, pull_request]
jobs:
build:
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
sudo apt update
sudo apt install devscripts shellcheck shfmt
- run: checkbashisms $(shfmt -f .)
- run: shellcheck $(shfmt -f .)
- run: shfmt -d -i 4 -sr $(shfmt -f .)
lint:
uses: open-contracting/.github/.github/workflows/shell.yml@main
15 changes: 5 additions & 10 deletions .github/workflows/spellcheck.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
name: Spell-check
on: [push, pull_request]
jobs:
build:
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- run: pip install codespell
- run: codespell -S .git,docson,locale,currency.csv,language.csv -L extensiones,zar .
lint:
uses: open-contracting/.github/.github/workflows/spellcheck.yml@main
with:
ignore: extensiones,zar
skip: docson,locale,currency.csv,language.csv
3 changes: 0 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
import csv
import json
import os
Expand Down
16 changes: 9 additions & 7 deletions manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,19 @@ def update():
codelists = [os.path.basename(filename) for filename in filenames]

f.write(
dedent(f"""\
# Codelists
dedent(
f"""\
# Codelists
<!-- Do not edit this file. This file is managed by manage.py -->
<!-- Do not edit this file. This file is managed by manage.py -->
For more information on codelists, refer to the [codelists reference](https://standard.open-contracting.org/1.1/en/schema/codelists/) in the OCDS documentation.
For more information on codelists, refer to the [codelists reference](https://standard.open-contracting.org/1.1/en/schema/codelists/) in the OCDS documentation.
The codelists below are from the OCDS and its extensions, and are provided here for convenience only.
The codelists below are from the OCDS and its extensions, and are provided here for convenience only.
The codelists can be downloaded as CSV files from <https://standard.open-contracting.org/profiles/{conf.profile_identifier}/latest/en/_static/patched/codelists/>.
""") # noqa: E501
The codelists can be downloaded as CSV files from <https://standard.open-contracting.org/profiles/{conf.profile_identifier}/latest/en/_static/patched/codelists/>.
""" # noqa: E501
)
)

for filename in sorted(codelists):
Expand Down
2 changes: 1 addition & 1 deletion script/diff
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -u

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

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

Expand Down

0 comments on commit ccc943e

Please sign in to comment.