-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set up CI with poetry and tests (#17)
* Set up CI with poetry and tests * Run from the venv * Making pytest happy. * Turns out you have to commit all the changes. * See if we can get this to work with HELM's enormous cache. * Another try at fixing caching.
- Loading branch information
Showing
5 changed files
with
56 additions
and
2 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,52 @@ | ||
name: Python application | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: cache poetry install | ||
uses: actions/cache@v3 | ||
id: cache-poetry | ||
with: | ||
path: ~/.local | ||
key: poetry-1.7.1-0 | ||
|
||
- name: Install and configure Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
version: 1.7.1 | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
|
||
- name: cache deps | ||
id: cache-deps | ||
uses: actions/cache@v3 | ||
with: | ||
path: .venv | ||
key: pydeps-${{ hashFiles('**/poetry.lock') }} | ||
|
||
|
||
- name: Install dependencies | ||
run: poetry install --no-interaction --no-root | ||
if: steps.cache-deps.outputs.cache-hit != 'true' | ||
|
||
- name: Test with pytest | ||
run: | | ||
source .venv/bin/activate | ||
pytest |
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
Empty file.
File renamed without changes.
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