diff --git a/.github/workflows/dev-checks.yml b/.github/workflows/dev-checks.yml index d2c6cff8..59eccc52 100644 --- a/.github/workflows/dev-checks.yml +++ b/.github/workflows/dev-checks.yml @@ -28,13 +28,3 @@ jobs: run: npm run build - name: Run lint check run: npm run lint - - name: Run unit tests - run: npm run test:coverage - - name: Run unit tests with cockpit - run: npm run test:cockpit - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v4 - with: - token: ${{ secrets.CODECOV_TOKEN }} - files: ./coverage/junit.xml - verbose: true diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml new file mode 100644 index 00000000..0dd9f89f --- /dev/null +++ b/.github/workflows/unit-tests.yml @@ -0,0 +1,45 @@ +name: Unit Tests + +on: + pull_request: + branches: [ "main" ] + push: + branches: [ "main" ] + merge_group: + +jobs: + unit-tests: + name: Service Tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Use Node.js 20 + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'npm' + - name: Install dependencies + run: npm ci + - name: Run unit tests + run: npm run test:coverage + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: ./coverage/junit.xml + verbose: true + + cockpit-unit-tests: + name: Cockpit Tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Use Node.js 20 + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'npm' + - name: Install dependencies + run: npm ci + - name: Run unit tests with cockpit + run: npm run test:cockpit