diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index d7ba04ea..68c6a4db 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -33,29 +33,6 @@ jobs: name: docker-image path: /tmp/docker-image.tar - test-backend: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 - with: - go-version-file: 'backend/go.mod' - cache-dependency-path: 'backend/go.sum' - - name: Install dependencies - working-directory: backend - run: | - go get ./... - - name: Run backend unit tests - working-directory: backend - run: | - go test -v ./... | tee /tmp/TestResults.log - - uses: actions/upload-artifact@v4 - if: always() - with: - name: backend-unit-tests - path: /tmp/TestResults.log - retention-days: 15 - test-sqlite: runs-on: ubuntu-latest needs: build diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml new file mode 100644 index 00000000..3976f621 --- /dev/null +++ b/.github/workflows/unit-tests.yml @@ -0,0 +1,34 @@ +name: Unit Tests +on: + push: + branches: [main] + paths: + - "backend/**" + pull_request: + branches: [main] + paths: + - "backend/**" + +jobs: + test-backend: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version-file: 'backend/go.mod' + cache-dependency-path: 'backend/go.sum' + - name: Install dependencies + working-directory: backend + run: | + go get ./... + - name: Run backend unit tests + working-directory: backend + run: | + go test -v ./... | tee /tmp/TestResults.log + - uses: actions/upload-artifact@v4 + if: always() + with: + name: backend-unit-tests + path: /tmp/TestResults.log + retention-days: 15