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 61bedba commit 0bd5781
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 102 deletions.
53 changes: 11 additions & 42 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,15 @@ 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
# Disable linkcheck as it is too slow for development.
# - run: |
# make linkcheck
# rm -f output.json output.txt
uses: open-contracting/.github/.github/workflows/ci-profile.yml@main
secrets:
private-key: ${{ secrets.PRIVATE_KEY }}
elasticsearch-password: ${{ secrets.ELASTICSEARCH_PASSWORD }}
with:
path-prefix: ''
version: '1.1'
production-refs: '["refs/heads/1.0", "refs/heads/1.1"]'
# Linkcheck is slow for development.
linkcheck: false
# "ResourceWarning: unclosed file <_io.BufferedWriter name='/dev/null'>"
- run: pytest -W error -W ignore::ResourceWarning
# 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: ""
PRODUCTION: ${{ startsWith(github.ref, 'refs/tags') || github.ref == 'refs/heads/latest' || github.ref == 'refs/heads/1.0' || github.ref == 'refs/heads/1.1' }}
RELEASE: ${{ startsWith(github.ref, 'refs/tags') }}
VERSION: "1.1"
shell: bash
run: curl -sS https://raw.githubusercontent.com/open-contracting/deploy/main/deploy-docs.sh | bash -
pytest-options: -W ignore::ResourceWarning
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/script.js
lint:
uses: open-contracting/.github/.github/workflows/js.yml@main
with:
filenames: docs/_static/script.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,examples,country.csv,currency.csv,language.csv,mediaType.csv -L fo,sme,zar,SME .
lint:
uses: open-contracting/.github/.github/workflows/spellcheck.yml@main
with:
ignore: fo,sme,zar
skip: docson,locale,examples,country.csv,currency.csv,language.csv,mediaType.csv
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
"license_url": f"{repository_url}/blob/HEAD/LICENSE",
"repository_url": repository_url,
}
html_short_title = f"{html_theme_options["short_project"]} v{release}"
html_short_title = f"{html_theme_options['short_project']} v{release}"

# List the extension identifiers and versions that should be part of this specification. The extensions must be in
# the extension registry: https://github.com/open-contracting/extension_registry/blob/main/extension_versions.csv
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 0bd5781

Please sign in to comment.