-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Component for adding file metadata to extra context for detail & edit pages
- Loading branch information
Showing
6 changed files
with
133 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,33 @@ | ||
name: Test python | ||
name: Build and test | ||
|
||
on: [ push ] | ||
on: | ||
workflow_call: | ||
inputs: | ||
oarepo: | ||
description: OARepo version (11, 12, ...) | ||
required: true | ||
default: 11 | ||
type: string | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [ "3.9", "3.10" ] | ||
services: | ||
redis: | ||
# Docker Hub image | ||
image: redis | ||
# Set health checks to wait until redis has started | ||
postgres: | ||
image: postgres | ||
env: | ||
POSTGRES_PASSWORD: postgres | ||
options: >- | ||
--health-cmd "redis-cli ping" | ||
--health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
ports: | ||
- 6379:6379 | ||
strategy: | ||
matrix: | ||
python-version: [ "3.9", "3.10" ] | ||
- 5432:5432 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
|
@@ -46,51 +54,35 @@ jobs: | |
- name: Runs Opensearch | ||
uses: ankane/setup-opensearch@v1 | ||
with: | ||
plugins: analysis-icu | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip wheel setuptools | ||
pip install -e '.[devs]' | ||
pip list | ||
- name: Start Redis | ||
uses: supercharge/[email protected] | ||
with: | ||
redis-version: ${{ matrix.redis-version }} | ||
|
||
- name: Test with pytest | ||
- name: Run tests | ||
run: | | ||
pip install -e '.[tests]' | ||
pip uninstall -y uritemplate.py || true | ||
pip uninstall -y uritemplate || true | ||
pip install -U uritemplate | ||
pytest tests | ||
./run-tests.sh | ||
|
||
- name: Build package to publish | ||
run: | | ||
python setup.py sdist bdist_wheel | ||
.venv/bin/python setup.py sdist bdist_wheel | ||
- name: Freeze packages | ||
run: | | ||
.venv/bin/pip freeze > requirements.txt | ||
- name: Archive production artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: dist | ||
path: dist | ||
|
||
deploy: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- name: Use built artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: dist | ||
path: dist | ||
|
||
- name: List files | ||
run: | | ||
ls -la | ||
ls -la dist | ||
- name: Publish package | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
- name: Archive production artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
skip_existing: true | ||
user: __token__ | ||
password: ${{ secrets.PYPI_PASSWORD }} | ||
name: requirements.txt | ||
path: requirements.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: Dispatch | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
oarepo: | ||
description: OARepo version (11, 12, ...) | ||
required: true | ||
default: 11 | ||
|
||
jobs: | ||
build: | ||
uses: ./.github/workflows/build.yaml | ||
with: | ||
oarepo: ${{ github.event.inputs.oarepo }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Build, test and publish | ||
|
||
on: push | ||
|
||
permissions: | ||
id-token: write | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
uses: ./.github/workflows/build.yaml | ||
with: | ||
oarepo: 11 | ||
|
||
publish: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- name: Use built artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: dist | ||
path: dist | ||
|
||
- name: List files | ||
run: | | ||
ls -la | ||
ls -la dist | ||
- name: Publish package | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
skip_existing: true | ||
user: __token__ | ||
password: ${{ secrets.PYPI_PASSWORD }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
OAREPO_VERSION="${OAREPO_VERSION:-11}" | ||
OAREPO_VERSION_MAX=$((OAREPO_VERSION+1)) | ||
|
||
|
||
VENV=".venv" | ||
|
||
if test -d $VENV ; then | ||
rm -rf $VENV | ||
fi | ||
|
||
python3 -m venv $VENV | ||
. $VENV/bin/activate | ||
pip install -U setuptools pip wheel | ||
|
||
pip install "oarepo>=${OAREPO_VERSION},<${OAREPO_VERSION_MAX}" | ||
pip install -e ".[tests]" | ||
|
||
pip uninstall -y uritemplate | ||
pip install uritemplate | ||
|
||
invenio index destroy --force --yes-i-know || true | ||
|
||
pytest tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters