-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Setup GitHub actions * Improve CI workflow and add documentation build one --------- Co-authored-by: Piotr Gródek <[email protected]>
- Loading branch information
1 parent
4d6bfc4
commit 8bfd46e
Showing
2 changed files
with
106 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,73 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
lints: | ||
name: Run linters | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.11" | ||
|
||
- name: Cache pre-commit | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.cache/pre-commit | ||
key: pre-commit-3|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }} | ||
|
||
- name: Install pre-commit | ||
run: pip3 install pre-commit | ||
|
||
- name: Run pre-commit checks | ||
run: pre-commit run --all-files --show-diff-on-failure --color always | ||
|
||
- name: Run Trivy vulnerability scanner | ||
uses: aquasecurity/[email protected] | ||
with: | ||
scan-type: "fs" | ||
ignore-unfixed: true | ||
format: "table" | ||
severity: "CRITICAL,HIGH" | ||
|
||
- name: Create venv | ||
run: . ./setup_dev_env.sh | ||
|
||
- name: Check licenses | ||
run: ./check_licenses.sh | ||
|
||
tests: | ||
name: Run tests | ||
runs-on: ubuntu-latest | ||
container: python:3.11 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Cache Dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements-dev.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
- name: Install Dependencies | ||
run: pip install -r requirements-dev.txt | ||
|
||
- name: Run Tests | ||
run: pytest -v -p no:warnings --junitxml=report.xml tests/ | ||
|
||
- name: Publish Test Report | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: Test Report | ||
path: report.xml | ||
retention-days: 10 |
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,33 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
pages: | ||
runs-on: ubuntu-latest | ||
container: python:3.11 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Cache Dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
- name: Install Dependencies | ||
run: pip install -r requirements.txt | ||
|
||
- name: Build docs | ||
run: ./build_docs.sh | ||
|
||
- name: Deploy | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./public |