Skip to content

Commit

Permalink
TST: refactor CI
Browse files Browse the repository at this point in the history
  • Loading branch information
adamchengtkc committed Nov 20, 2023
1 parent 78731bd commit 1324865
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 23 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ jobs:
name: Build
uses: docker/build-push-action@v2
with:
file: .devcontainer/Dockerfile
context: .
file: Dockerfile
context: .devcontainer
push: true
platforms: linux/amd64
tags: ghcr.io/equinor/warmth:latest
2 changes: 1 addition & 1 deletion .github/workflows/python-test-3d.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
args: |
cd /warmth && \
pip install pytest==7.4.2 pytest-cov==4.1.0 . && \
pytest --cov-report=term-missing --cov=warmth tests/ | tee pytest-coverage.txt
pytest --cov-report=term-missing --cov=warmth tests/warmth3d | tee pytest-coverage.txt
- name: Comment coverage
Expand Down
31 changes: 15 additions & 16 deletions .github/workflows/python-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,28 +46,27 @@ jobs:
- name: Test with pytest
run: |
poetry run pytest --cov-report=term-missing --ignore=tests/3d --cov=warmth tests/ | tee pytest-coverage.txt
poetry run pytest --cov-report=term-missing --ignore=tests/warmth3d --cov=warmth tests/ | tee pytest-coverage.txt
- name: Comment coverage
if: ${{ github.event_name == 'pull_request' && github.event.action == 'opened' }}
uses: coroo/[email protected]
with:
pytest-coverage: pytest-coverage.txt

- name: check_3d_modified
uses: dorny/paths-filter@v2
id: filter3d
with:
filters: |
mesh3d:
- 'warmth/3d/**'
outputs:
filter3d: ${{ steps.filter3d.outputs.mesh3d }}

test3d:
needs: [build]
uses: equinor/warmth/.github/workflows/python-test-3d.yml@main
if: ${{ needs.build.outputs.filter3d }} == 'true'
with:
event_type: ${{ github.event_name}}
action_type: ${{ github.event.action}}
runs-on: ubuntu-latest
steps:
- name: check_3d_modified
uses: dorny/paths-filter@v2
id: filter3d
with:
filters: |
mesh3d:
- 'warmth/3d/**'
- uses: equinor/warmth/.github/workflows/python-test-3d.yml@main
if: ${{ steps.filter3d.outputs.mesh3d }} == 'true'
with:
event_type: ${{ github.event_name}}
action_type: ${{ github.event.action}}
4 changes: 0 additions & 4 deletions .github/workflows/snyk.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
name: Snyk scan
on:
push:
branches: [main, dev]
pull_request:
branches: [main, dev]
workflow_call:
jobs:
security:
Expand Down

0 comments on commit 1324865

Please sign in to comment.