-
Notifications
You must be signed in to change notification settings - Fork 2
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
1 parent
c83b3a2
commit 23e34f3
Showing
2 changed files
with
85 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,38 @@ | ||
name: Lint code | ||
|
||
on: | ||
workflow_call: | ||
|
||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ['3.8'] | ||
env: | ||
PYTHONPATH: ${{ github.workspace }}/install/lib/python${{ matrix.python-version }}/site-packages:${{ github.workspace }}/install/lib/python${{ matrix.python-version }}/dist-packages | ||
|
||
steps: | ||
- name: Checkout commit locally | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install subscript-internal with dependencies | ||
run: | | ||
pip install --upgrade pip | ||
pip install ".[tests,docs,ert]" | ||
- name: List all installed packages | ||
run: pip freeze | ||
|
||
- name: Install pre-commit | ||
run: pip install pre-commit | ||
|
||
- name: Run pre-commit | ||
run: | | ||
SKIP="no-commit-to-branch" pre-commit run --all-files |
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,47 @@ | ||
name: Test & Lint | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
release: | ||
types: | ||
- published | ||
schedule: | ||
# Run CI every night and check that tests are working with the latest dependencies. | ||
- cron: '0 0 * * *' | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ['3.8', '3.9', '3.10', '3.11'] | ||
env: | ||
PYTHONPATH: ${{ github.workspace }}/install/lib/python${{ matrix.python-version }}/site-packages:${{ github.workspace }}/install/lib/python${{ matrix.python-version }}/dist-packages | ||
|
||
steps: | ||
- name: Checkout commit locally | ||
uses: actions/checkout@v3 | ||
|
||
- name: Checkout tags | ||
# Necessary for setuptools_scm to be able to infer the correct version. | ||
run: git fetch --unshallow --tags | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install subscript-internal with dependencies | ||
run: | | ||
pip install --upgrade pip | ||
pip install ".[tests,docs,ert]" | ||
- name: Run tests | ||
run: | | ||
python -c "import completor" | ||
pytest tests/ |