-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into isabellec/arcadev2output
- Loading branch information
Showing
39 changed files
with
4,100 additions
and
1,942 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 |
---|---|---|
|
@@ -8,15 +8,15 @@ jobs: | |
|
||
strategy: | ||
matrix: | ||
python-version: [3.9] | ||
python-version: ["3.9", "3.10"] | ||
|
||
steps: | ||
|
||
- name: Checkout the repo | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
|
@@ -28,7 +28,7 @@ jobs: | |
|
||
- name: Load cached venv | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v2 | ||
uses: actions/cache@v3 | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} | ||
|
@@ -45,11 +45,90 @@ jobs: | |
- name: Test with pytest | ||
run: | | ||
source .venv/bin/activate | ||
pytest --cov-report xml --cov=src/ tests/ | ||
pytest --cov-report html --cov=src/ tests/ | ||
rm htmlcov/.gitignore | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v2 | ||
- name: Publish coverage report | ||
if: ${{ github.ref == 'refs/heads/main' && matrix.python-version == '3.10' }} | ||
uses: JamesIves/github-pages-deploy-action@v4 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
file: ./coverage.xml | ||
verbose: true | ||
branch: gh-pages | ||
folder: htmlcov | ||
target-folder: _coverage | ||
|
||
- name: Extract coverage percent | ||
if: ${{ github.ref == 'refs/heads/main' && matrix.python-version == '3.10' }} | ||
run: | | ||
echo "COVERAGE=$(grep -oP 'pc_cov">\K([0-9]+)' htmlcov/index.html)" >> $GITHUB_ENV | ||
- name: Generate coverage badge | ||
if: ${{ github.ref == 'refs/heads/main' && matrix.python-version == '3.10' }} | ||
uses: knightdave/[email protected] | ||
with: | ||
file: docs/_badges/coverage.svg | ||
label: coverage | ||
value: ${{ env.COVERAGE }} | ||
value_format: "%d%%" | ||
anybadge_args: 50=red 60=orange 80=yellow 100=green | ||
template: docs/_badges/template.svg | ||
overwrite: true | ||
|
||
- name: Publish badge | ||
if: ${{ github.ref == 'refs/heads/main' && matrix.python-version == '3.10' }} | ||
uses: JamesIves/github-pages-deploy-action@v4 | ||
with: | ||
branch: gh-pages | ||
folder: docs/_badges | ||
target-folder: _badges | ||
clean: false | ||
|
||
result: | ||
if: ${{ always() }} | ||
|
||
runs-on: ubuntu-latest | ||
|
||
needs: [build] | ||
|
||
steps: | ||
|
||
- name: Checkout the repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Get build result | ||
run: | | ||
if [[ ${{ needs.build.result }} == "success" || ${{ needs.build.result }} == "skipped" ]]; then | ||
exit 0 | ||
else | ||
exit 1 | ||
fi | ||
- name: Generate passing badge | ||
if: success() | ||
uses: knightdave/[email protected] | ||
with: | ||
file: docs/_badges/build.svg | ||
label: build | ||
value: passing | ||
color: green | ||
template: docs/_badges/template.svg | ||
overwrite: true | ||
|
||
- name: Generate failing badge | ||
if: failure() | ||
uses: knightdave/[email protected] | ||
with: | ||
file: docs/_badges/build.svg | ||
label: build | ||
value: failing | ||
color: red | ||
template: docs/_badges/template.svg | ||
overwrite: true | ||
|
||
- name: Publish badge | ||
if: success() || failure() | ||
uses: JamesIves/github-pages-deploy-action@v4 | ||
with: | ||
branch: gh-pages | ||
folder: docs/_badges | ||
target-folder: _badges | ||
clean: false |
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 |
---|---|---|
|
@@ -12,25 +12,101 @@ jobs: | |
steps: | ||
|
||
- name: Checkout the repo | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v2 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.9 | ||
|
||
- name: Install poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
|
||
- name: Load cached venv | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} | ||
|
||
- name: Install dependencies | ||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
run: | | ||
poetry install --no-interaction --no-root | ||
- name: Install library | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install Sphinx sphinx-rtd-theme sphinx-mdinclude | ||
poetry install --no-interaction | ||
- name: Generate documentation with Sphinx | ||
run: | | ||
source .venv/bin/activate | ||
make docs | ||
touch docs/_build/html/.nojekyll | ||
- name: Publish docs | ||
uses: JamesIves/[email protected] | ||
uses: JamesIves/github-pages-deploy-action@v4 | ||
with: | ||
branch: gh-pages | ||
folder: docs/_build/html | ||
clean-exclude: | | ||
_badges | ||
_coverage | ||
- name: Generate style badge | ||
uses: knightdave/[email protected] | ||
with: | ||
file: docs/_badges/style.svg | ||
label: code style | ||
value: black | ||
color: black | ||
template: docs/_badges/template.svg | ||
overwrite: true | ||
|
||
- name: Extract license | ||
run: | | ||
echo "LICENSE=$(grep -oP 'license = "\K([A-z-0-9]+)(?=")' pyproject.toml)" >> $GITHUB_ENV | ||
- name: Generate license badge | ||
uses: knightdave/[email protected] | ||
with: | ||
file: docs/_badges/license.svg | ||
label: license | ||
value: ${{ env.LICENSE }} | ||
color: yellowgreen | ||
template: docs/_badges/template.svg | ||
overwrite: true | ||
|
||
- name: Generate passing badge | ||
if: success() | ||
uses: knightdave/[email protected] | ||
with: | ||
file: docs/_badges/documentation.svg | ||
label: docs | ||
value: passing | ||
color: green | ||
template: docs/_badges/template.svg | ||
overwrite: true | ||
|
||
- name: Generate failing badge | ||
if: failure() | ||
uses: knightdave/[email protected] | ||
with: | ||
file: docs/_badges/documentation.svg | ||
label: docs | ||
value: failing | ||
color: red | ||
template: docs/_badges/template.svg | ||
overwrite: true | ||
|
||
- name: Publish badge | ||
if: success() || failure() | ||
uses: JamesIves/github-pages-deploy-action@v4 | ||
with: | ||
branch: gh-pages | ||
folder: docs/_build/html/ | ||
folder: docs/_badges | ||
target-folder: _badges | ||
clean: false |
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 |
---|---|---|
|
@@ -9,10 +9,10 @@ jobs: | |
steps: | ||
|
||
- name: Checkout the repo | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v2 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.9 | ||
|
||
|
@@ -24,7 +24,7 @@ jobs: | |
|
||
- name: Load cached venv | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v2 | ||
uses: actions/cache@v3 | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} | ||
|
@@ -44,7 +44,43 @@ jobs: | |
source .venv/bin/activate | ||
black -l 100 --check src/ tests/ | ||
- name: Check with isort | ||
run: | | ||
source .venv/bin/activate | ||
isort -l 100 --check src/ tests/ | ||
- name: Check with mypy | ||
run: | | ||
source .venv/bin/activate | ||
mypy --config-file mypy.ini src | ||
mypy src | ||
- name: Generate passing badge | ||
if: success() | ||
uses: knightdave/[email protected] | ||
with: | ||
file: docs/_badges/lint.svg | ||
label: lint | ||
value: passing | ||
color: green | ||
template: docs/_badges/template.svg | ||
overwrite: true | ||
|
||
- name: Generate failing badge | ||
if: failure() | ||
uses: knightdave/[email protected] | ||
with: | ||
file: docs/_badges/lint.svg | ||
label: lint | ||
value: failing | ||
color: red | ||
template: docs/_badges/template.svg | ||
overwrite: true | ||
|
||
- name: Publish badge | ||
if: success() || failure() | ||
uses: JamesIves/github-pages-deploy-action@v4 | ||
with: | ||
branch: gh-pages | ||
folder: docs/_badges | ||
target-folder: _badges | ||
clean: false |
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 |
---|---|---|
|
@@ -8,15 +8,20 @@ on: | |
- closed | ||
|
||
jobs: | ||
release: | ||
publish: | ||
if: ${{ (startsWith(github.event.pull_request.head.ref, 'release/')) && (github.event.pull_request.merged == true) }} | ||
|
||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
id-token: write | ||
contents: write | ||
pull-requests: read | ||
|
||
steps: | ||
|
||
- name: Checkout the repo | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v3 | ||
|
||
- name: Extract version from branch name | ||
run: | | ||
|
@@ -46,6 +51,10 @@ jobs: | |
{ | ||
"title": "## 📓 Documentation", | ||
"labels": ["type: docs"] | ||
}, | ||
{ | ||
"title": "## 📁 Admin", | ||
"labels": ["type: admin"] | ||
} | ||
], | ||
"template": "#{{CHANGELOG}}---\n\n**Full Changelog**: https://github.com/${{ github.repository }}/compare/#{{FROM_TAG}}...${{ env.RELEASE_VERSION }}\n", | ||
|
@@ -61,10 +70,9 @@ jobs: | |
tag: ${{ env.RELEASE_VERSION }} | ||
name: ${{ env.RELEASE_VERSION }} | ||
body: ${{ steps.build_changelog.outputs.changelog }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v2 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.9 | ||
|
||
|
@@ -80,5 +88,23 @@ jobs: | |
- name: Publish package | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
|
||
- name: Generate version badge | ||
if: success() | ||
uses: knightdave/[email protected] | ||
with: | ||
file: docs/_badges/version.svg | ||
label: version | ||
value: ${{ env.RELEASE_VERSION }} | ||
color: teal | ||
template: docs/_badges/template.svg | ||
overwrite: true | ||
|
||
- name: Publish badge | ||
if: success() | ||
uses: JamesIves/github-pages-deploy-action@v4 | ||
with: | ||
password: ${{ secrets.PYPI_TOKEN }} | ||
branch: gh-pages | ||
folder: docs/_badges | ||
target-folder: _badges | ||
clean: false |
Oops, something went wrong.