From 132486526954d0f88d56ed5204da80b5b5294b17 Mon Sep 17 00:00:00 2001 From: Adam Cheng <52572642+adamchengtkc@users.noreply.github.com> Date: Mon, 20 Nov 2023 13:46:39 +0000 Subject: [PATCH] TST: refactor CI --- .github/workflows/build_docker.yml | 4 ++-- .github/workflows/python-test-3d.yml | 2 +- .github/workflows/python-test.yml | 31 ++++++++++++++-------------- .github/workflows/snyk.yml | 4 ---- 4 files changed, 18 insertions(+), 23 deletions(-) diff --git a/.github/workflows/build_docker.yml b/.github/workflows/build_docker.yml index c3c681f..be30334 100644 --- a/.github/workflows/build_docker.yml +++ b/.github/workflows/build_docker.yml @@ -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 diff --git a/.github/workflows/python-test-3d.yml b/.github/workflows/python-test-3d.yml index 0fdec75..3097003 100644 --- a/.github/workflows/python-test-3d.yml +++ b/.github/workflows/python-test-3d.yml @@ -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 diff --git a/.github/workflows/python-test.yml b/.github/workflows/python-test.yml index 5168f78..5b6a59c 100644 --- a/.github/workflows/python-test.yml +++ b/.github/workflows/python-test.yml @@ -46,7 +46,7 @@ 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' }} @@ -54,20 +54,19 @@ jobs: 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}} diff --git a/.github/workflows/snyk.yml b/.github/workflows/snyk.yml index 59918e5..dc6f7cd 100644 --- a/.github/workflows/snyk.yml +++ b/.github/workflows/snyk.yml @@ -1,9 +1,5 @@ name: Snyk scan on: - push: - branches: [main, dev] - pull_request: - branches: [main, dev] workflow_call: jobs: security: