test: tests simplified #110
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
name: π§ͺ Continuous Integration | |
jobs: | |
ci: | |
runs-on: ubuntu-latest | |
steps: | |
- name: π₯ Checkout | |
uses: actions/checkout@v3 | |
- name: π Install Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 22 | |
- name: π Install pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 9 | |
run_install: false | |
- name: ποΈ Install Dependencies | |
run: | | |
pnpm install | |
- name: π Start Frontend and Backend | |
run: | | |
docker pull ghcr.io/simplytest/banking-backend:latest | |
docker run -d -p 5005:5005 -e "SIMPLYTEST_DEMO=ON" --rm --name=Banking-Backend-Demo ghcr.io/simplytest/banking-backend:latest | |
pnpm run start > log.txt 2>&1 & | |
- name: β Wait for Frontend | |
uses: iFaxity/[email protected] | |
with: | |
resource: http://localhost:4200 | |
delay: 1000 | |
httpTimeout: 500 | |
timeout: 60000 | |
- name: π§ͺ Integration Tests | |
run: | | |
pnpm run test:int | |
- name: π§ͺ End To End Tests | |
run: | | |
pnpm run test:e2e | |
- name: π Check for duplicate reports | |
id: skip_check | |
uses: fkirc/skip-duplicate-actions@v5 | |
with: | |
skip_after_successful_duplicate: true | |
concurrent_skipping: "same_content_newer" | |
- name: π Integration Test Report | |
uses: phoenix-actions/test-reporting@v8 | |
if: steps.skip_check.outputs.should_skip != 'true' && (success() || failure()) | |
with: | |
name: π Integration Test Report | |
reporter: java-junit | |
path: "results/integration*.xml" | |
- name: π E2E Test Report | |
uses: phoenix-actions/test-reporting@v8 | |
if: steps.skip_check.outputs.should_skip != 'true' && (success() || failure()) | |
with: | |
name: π E2E Test Report | |
reporter: java-junit | |
path: "results/e2e*.xml" | |
- name: π Sonar Scan | |
if: github.ref == 'refs/heads/main' | |
uses: sonarsource/[email protected] | |
env: | |
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }} | |
SONAR_HOST_URL: ${{ vars.SONARQUBE_HOST }} | |
- name: π€ Sonar Summary | |
if: github.ref == 'refs/heads/main' | |
run: | | |
{ | |
echo "### π€ Sonar Summary" | |
echo "${{ vars.SONARQUBE_HOST }}" | |
} >> $GITHUB_STEP_SUMMARY | |
- name: π Upload PNPM Logs | |
if: ${{ always() }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: PNPM Log | |
path: log.txt |