From d81b104291441f48ff77bf5844c7adf62f5faa65 Mon Sep 17 00:00:00 2001 From: Tim Pietrusky Date: Tue, 28 May 2024 16:30:25 +0200 Subject: [PATCH] ci: run tests in separate workflow on push / PR --- .github/workflows/dev.yml | 3 --- .github/workflows/release.yml | 6 ------ .github/workflows/test.yml | 27 +++++++++++++++++++++++++++ 3 files changed, 27 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 1c8f904..065cf3e 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -21,9 +21,6 @@ jobs: - name: Install dependencies run: pip install -r requirements.txt - - name: Run tests - run: python -m unittest discover - - name: Clear space to remove unused folders run: | rm -rf /usr/share/dotnet diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e9ff3ad..eaaf223 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,9 +27,6 @@ jobs: - name: Install dependencies run: pip install -r requirements.txt - - name: Run tests - run: python -m unittest discover - - name: Clear space to remove unused folders run: | rm -rf /usr/share/dotnet @@ -77,6 +74,3 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} repository: ${{ secrets.DOCKERHUB_REPO }}/${{ secrets.DOCKERHUB_IMG }} - - - diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..8fef7af --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,27 @@ +name: Tests + +on: + push: + branches: [main, dev] + pull_request: + types: [opened, synchronize] + branches: [main, dev] + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.10" + + - name: Install dependencies + run: pip install -r requirements.txt + + - name: Run tests + run: python -m unittest discover