-
Notifications
You must be signed in to change notification settings - Fork 9
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
3 changed files
with
66 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,54 @@ | ||
--- | ||
name: "Linting and Tests" | ||
on: | ||
- push | ||
- workflow_dispatch | ||
|
||
jobs: | ||
linting: | ||
runs-on: "ubuntu-24.04" | ||
|
||
steps: | ||
# Checkout this repository | ||
- uses: actions/checkout@v4 | ||
|
||
# Setup the specified Python version | ||
- name: "Set up Python 3.12" | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.12" | ||
cache: pip | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install -r ./requirements.txt | ||
- name: Linting (pylama) | ||
run: pylama . | ||
|
||
- name: Linting (black) | ||
run: black --check . | ||
|
||
pytest: | ||
needs: linting | ||
runs-on: "ubuntu-24.04" | ||
|
||
steps: | ||
# Checkout this repository | ||
- uses: actions/checkout@v4 | ||
|
||
# Setup the specified Python version | ||
- name: "Set up Python 3.12" | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.12" | ||
cache: pip | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install -r ./requirements.txt | ||
- name: Execute Tests | ||
run: py.test -s -v tests/ |
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 |
---|---|---|
|
@@ -2,3 +2,4 @@ setuptools | |
rich==13.7.0 | ||
pylama==8.4.1 | ||
black==24.4.2 | ||
pytest==8.2.2 |
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,11 @@ | ||
import os | ||
|
||
|
||
def test_gh_actions(): | ||
running_in_gh = os.getenv("GITHUB_ACTIONS") | ||
assert running_in_gh | ||
|
||
|
||
def test_env_var(): | ||
my_env = os.getenv("ENVIRONMENT", "local") | ||
assert my_env == "gh_actions" |