commands.extract:rollback_extract - add handler to roll back extraction #540
Workflow file for this run
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
name: Linting & Test | |
on: | |
push: | |
paths: | |
- digiarch/** | |
- tests/** | |
- pyproject.toml | |
- poetry.lock | |
- CHANGELOG.md | |
- .github/workflows/test.yml | |
env: | |
PYTHON_VERSION: 3.11.9 | |
POETRY_VERSION: 1.8.3 | |
jobs: | |
linting: | |
name: Check Linting & Types | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- uses: abatilo/actions-poetry@v2 | |
with: | |
poetry-version: ${{ env.POETRY_VERSION }} | |
- run: poetry install | |
- name: ruff check | |
run: poetry run ruff check digiarch | |
- name: ruff format | |
run: poetry run ruff format --check digiarch | |
version: | |
name: Test Version | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Get Versions | |
id: version | |
run: | | |
version_project="$(grep --color=never 'version *= *".*"' pyproject.toml)" | |
version_project="${version_project%\"}" | |
version_project="${version_project#*\"}" | |
echo "version_project=$version_project" >> "$GITHUB_OUTPUT" | |
project_name="$(grep --color=never 'name *= *".*"' pyproject.toml)" | |
project_name="${project_name%\"}" | |
project_name="${project_name#*\"}" | |
version_package="$(grep --color=never '__version__ *= *".*"' "$project_name"/__version__.py)" | |
version_package="${version_package%\"}" | |
version_package="${version_package#*\"}" | |
echo "version_package=$version_package" >> "$GITHUB_OUTPUT" | |
- name: Test Package and Project Version Match | |
env: | |
version_project: ${{ steps.version.outputs.version_project }} | |
version_package: ${{ steps.version.outputs.version_package }} | |
run: test "$version_project" = "$version_package" || exit $? | |
- name: Test Version in CHANGELOG.md | |
env: | |
version_project: ${{ steps.version.outputs.version_project }} | |
run: grep -E "## v$version_project"'( .*)?$' CHANGELOG.md || exit $? | |
version-acacore: | |
name: Test acacore Version | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Fetch Acacore Version | |
run: | | |
acacore_remote="$(python -c 'import urllib.request,json;print(json.loads(urllib.request.urlopen("https://api.github.com/repos/aarhusstadsarkiv/acacore/tags").read())[0]["name"])')" | |
acacore_remote="${acacore_remote#v}" | |
acacore_package="$(grep 'acacore =' pyproject.toml | grep -oE 'tag[ ]*=[ ]*"[^"]+"')" | |
acacore_package="${acacore_package#*\"}" | |
acacore_package="${acacore_package#v}" | |
acacore_package="${acacore_package%\"}" | |
test "$acacore_remote" = "$acacore_package" | |
version-database: | |
name: Test Database version | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Test database version | |
run: | | |
acacore_database="$(sqlite3 tests/AVID/_metadata/avid.db "select value from Metadata where key = 'version'")" | |
acacore_database="${acacore_database#*\"}" | |
acacore_database="${acacore_database#v}" | |
acacore_database="${acacore_database%\"}" | |
acacore_package="$(grep 'acacore =' pyproject.toml | grep -oE 'tag[ ]*=[ ]*"[^"]+"')" | |
acacore_package="${acacore_package#*\"}" | |
acacore_package="${acacore_package#v}" | |
acacore_package="${acacore_package%\"}" | |
test "$acacore_database" = "$acacore_package" | |
pytest: | |
name: pytest | |
needs: version-database | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- uses: abatilo/actions-poetry@v2 | |
with: | |
poetry-version: ${{ env.POETRY_VERSION }} | |
- uses: actions/setup-go@v4 | |
- run: poetry install | |
- run: go install github.com/richardlehane/siegfried/cmd/sf@latest | |
- name: Unit test | |
env: | |
GOPATH: /home/runner/go | |
run: | | |
poetry run coverage run -m pytest | |
poetry run coverage report -m --fail-under=80 --skip-empty --skip-covered |