-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
131 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,44 @@ | ||
name: 'Setup Python and Poetry.' | ||
description: 'Set up Python, install Poetry, cache dependencies, and install them with Poetry.' | ||
|
||
inputs: | ||
python-version: | ||
description: 'Version of Python to use.' | ||
required: true | ||
default: '3.11' | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
lfs: true | ||
|
||
- name: Checkout LFS objects | ||
shell: bash | ||
run: git lfs checkout | ||
|
||
- name: Set up Python ${{ inputs.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ inputs.python-version }} | ||
|
||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
installer-parallel: true | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} | ||
|
||
- name: Install dependencies with Poetry | ||
shell: bash | ||
run: | | ||
mkdir ./dist && touch ./dist/README.md | ||
poetry install --no-interaction | ||
poetry run playwright chromium --with-deps |
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,87 @@ | ||
name: Python CI | ||
|
||
on: | ||
push: | ||
branches: [ "develop", "master" ] | ||
pull_request: | ||
branches: [ "develop", "master" ] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-22.04 # https://github.com/actions/runner-images#available-images | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
lfs: true | ||
|
||
- name: Checkout LFS objects | ||
run: git lfs checkout | ||
|
||
- name: Set up Python 3.11 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.11" | ||
|
||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
installer-parallel: true | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} | ||
|
||
- name: Install dependencies with Poetry | ||
run: | | ||
mkdir ./dist && touch ./dist/README.md | ||
poetry install --no-interaction --with dev,cmd,cmd-dev,docs | ||
poetry run playwright chromium --with-deps | ||
test: | ||
needs: build | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
lfs: true | ||
|
||
- name: Checkout LFS objects | ||
run: git lfs checkout | ||
|
||
- name: Set up Python 3.11 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.11" | ||
|
||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
installer-parallel: true | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} | ||
|
||
- name: Install dependencies with Poetry | ||
run: | | ||
mkdir ./dist && touch ./dist/README.md | ||
poetry install --no-interaction --with dev,cmd,cmd-dev,docs | ||
poetry run playwright chromium --with-deps | ||
- name: Run tests with pytest | ||
env: | ||
FINGERPRINT_KEY: ${{ secrets.FINGERPRINT_KEY }} | ||
run: poetry run pytest -vv tests/ |