Skip to content

Commit 714f864

Browse files
committed
#510 4rd PoC - GHC with pixi in GitHub Workflows CI - fixes - use more pixi tasks
1 parent c9c3b2e commit 714f864

3 files changed

Lines changed: 18 additions & 4 deletions

File tree

.github/workflows/main.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,16 @@ jobs:
2929
- name: Setup GHC App and init DB 🗃️
3030
run: |
3131
pixi run -e dev setup
32-
echo -e "admin\ntest\ntest\nyou@example.com\nyou@example.com" | pixi run -e dev python3 GeoHealthCheck/models.py create
32+
pixi run -e dev create -u admin -p admin --e a@a.com
3333
3434
- name: Flake8 - Verify Coding Conventions ⚙️
3535
run: pixi run -e dev flake8
3636

3737
- name: Load Fixtures Test Data ⚙️
38-
run: pixi run -e dev python3 GeoHealthCheck/models.py load tests/data/fixtures.json y
38+
run: pixi run -e dev load-data tests/data/fixtures.json
3939

4040
- name: Run Probes ⚙️
41-
run: pixi run -e dev python3 GeoHealthCheck/healthcheck.py
41+
run: pixi run -e dev run-healthchecks
4242

4343
- name: Run Unit Tests ⚙️
4444
run: pixi run -e dev test
@@ -48,7 +48,7 @@ jobs:
4848
run: cat report.md >> "$GITHUB_STEP_SUMMARY" || true
4949

5050
- name: Build Docs 📖
51-
run: pixi run -e dev bash -c "cd docs && make html"
51+
run: pixi run -e dev refresh-docs
5252

5353
- name: Cleanup 💯
5454
run: pixi run -e dev python3 GeoHealthCheck/models.py drop

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,14 @@ pyproj = ">=2.6.1"
7575
# so it works for both dev and prod (README runs `invoke setup` for prod too).
7676
setup = "invoke setup"
7777
create = "invoke create"
78+
load-data = "invoke load-data"
7879
create-secret-key = "invoke create-secret-key"
7980
run = "python GeoHealthCheck/app.py"
8081
docs = "invoke refresh-docs"
8182
clean = "invoke clean"
8283
runner-daemon = "invoke runner-daemon"
8384
upgrade-db = "invoke upgrade"
85+
run-healthchecks = "invoke run-healthchecks"
8486
run-tests = "invoke run-tests"
8587

8688
[tool.pixi.feature.dev.dependencies]

tasks.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,18 @@ def create(c, email, username, password):
171171

172172
c.run(f'python {models_py} create {args}')
173173

174+
@task
175+
def load_data(c, file_path):
176+
"""populate database from data file"""
177+
178+
args = ''
179+
models_py = Path('GeoHealthCheck/models.py')
180+
181+
if None not in [file_path]:
182+
args = f'{file_path}'
183+
184+
c.run(f'python {models_py} load {args} y')
185+
174186

175187
@task
176188
def create_hash(c, password):

0 commit comments

Comments
 (0)