diff --git a/.github/workflows/_test.yml b/.github/workflows/_test.yml deleted file mode 100644 index ca74f84..0000000 --- a/.github/workflows/_test.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: Test - -on: - workflow_call: - -jobs: - test: - runs-on: ubuntu-latest - - steps: - - name: "Checkout Repository" - uses: "actions/checkout@v4" - - - name: "Install Python" - uses: "actions/setup-python@v5" - with: - python-version: "3.10" - - - name: "Install poetry" - run: "pip install --user poetry" - - - name: "Install dev environment" - run: poetry install --no-interaction --no-ansi - - - name: "pytest" - run: | - cp config/config.yml config.yml - poetry run pytest -k 'not test_extract_features and not test_batches' - - - name: "flake8" - run: "poetry run flake8" - - - name: "black" - run: "poetry run black --check ." - - - name: "mypy" - run: "poetry run mypy ." \ No newline at end of file diff --git a/.github/workflows/_deploy.yml b/.github/workflows/build-push-image.yml similarity index 70% rename from .github/workflows/_deploy.yml rename to .github/workflows/build-push-image.yml index ee2e7a6..875d9ec 100644 --- a/.github/workflows/_deploy.yml +++ b/.github/workflows/build-push-image.yml @@ -1,7 +1,10 @@ -name: Deploy dane-whisper-asr-worker to ghcr +name: Build & Push on: - workflow_call: + push: + branches: + - main + workflow_dispatch: jobs: build-push-image: @@ -10,4 +13,4 @@ jobs: permissions: contents: read packages: write - id-token: write \ No newline at end of file + id-token: write diff --git a/.github/workflows/main-branch.yml b/.github/workflows/main-branch.yml deleted file mode 100644 index 5f0de29..0000000 --- a/.github/workflows/main-branch.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: main branch - test; deploy (ecr, tst, acc, aws) - -on: - push: - branches: - - "main" - paths-ignore: - - README.md - - LICENSE - - docker-compose.yml - -jobs: - test: - uses: ./.github/workflows/_test.yml - - deploy: - uses: ./.github/workflows/_deploy.yml - permissions: - contents: read - packages: write - id-token: write - needs: [test] diff --git a/.github/workflows/manual-deploy.yml b/.github/workflows/manual-deploy.yml deleted file mode 100644 index 2def253..0000000 --- a/.github/workflows/manual-deploy.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Manual deploy - -on: - workflow_dispatch: - -jobs: - test: - uses: ./.github/workflows/_test.yml - - deploy: - uses: ./.github/workflows/_deploy.yml - permissions: - contents: read - packages: write - id-token: write - needs: [test] diff --git a/.github/workflows/not-main-branch.yml b/.github/workflows/not-main-branch.yml deleted file mode 100644 index 5c56a2f..0000000 --- a/.github/workflows/not-main-branch.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: All branches but main - test only - -on: - push: - branches-ignore: - - "main" - paths-ignore: - - README.md - - LICENSE - - docker-compose.yml - -jobs: - test: - uses: "./.github/workflows/_test.yml" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..051b6a4 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,8 @@ +name: Check project + +on: + push: + +jobs: + check-project: + uses: beeldengeluid/gha-workflows/.github/workflows/check-poetry-project.yml@dd25210e68fdf86f4df924850cdfcfc91931faf3 diff --git a/pyproject.toml b/pyproject.toml index 08c48a1..7828997 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,8 +38,10 @@ testpaths = [ ] addopts = [ "--cov", + "-m not data_dependent and not legacy", ] markers = [ + "data_dependent: depends on data", "legacy: marks tests as legacy - includes audio processing (deselect with '-m \"not legacy\"')", "serial", ] diff --git a/tests/unit/data_handling_test.py b/tests/unit/data_handling_test.py index fda5e31..41e9d1f 100644 --- a/tests/unit/data_handling_test.py +++ b/tests/unit/data_handling_test.py @@ -3,6 +3,7 @@ import pytest +@pytest.mark.data_dependent @pytest.mark.parametrize("audio_too", [True, False]) def test_batches(audio_too): device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") diff --git a/tests/unit/feature_extraction_test.py b/tests/unit/feature_extraction_test.py index be64aca..b8a2b4e 100644 --- a/tests/unit/feature_extraction_test.py +++ b/tests/unit/feature_extraction_test.py @@ -28,6 +28,7 @@ def load_model(request): yield (model, config_file) +@pytest.mark.data_dependent @pytest.mark.parametrize("load_model", ["Visualnet"], indirect=True) def test_extract_features(load_model): feature_file = get_output_file_path(UNIT_TEST_SOURCE_ID, OutputType.FEATURES) @@ -62,6 +63,7 @@ def test_extract_features(load_model): @pytest.mark.legacy +@pytest.mark.data_dependent @pytest.mark.parametrize("load_model", ["AVNet"], indirect=True) def test_extract_features_legacy(load_model): feature_file = get_output_file_path(UNIT_TEST_SOURCE_ID, OutputType.FEATURES)