Documentation #246
This file contains hidden or 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
| name: Build | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| jobs: | |
| tests: | |
| runs-on: ubuntu-latest | |
| services: | |
| mongodb: | |
| image: mongo:latest | |
| ports: | |
| - 27017:27017 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: stable | |
| components: rustfmt, clippy | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| - run: npm --prefix users ci | |
| - run: npm --prefix webapp ci | |
| - run: npm --prefix multiplayer ci | |
| - name: Run users tests with coverage | |
| env: | |
| MONGODB_URI: mongodb://localhost:27017/testdb | |
| run: npm --prefix users run test:coverage | |
| - name: Run webapp tests with coverage | |
| run: npm --prefix webapp run test:coverage | |
| - name: Run multiplayer tests with coverage | |
| run: npm --prefix multiplayer run coverage | |
| - name: Install cargo-llvm-cov | |
| run: cargo install cargo-llvm-cov --locked | |
| - name: Generate gamey code coverage | |
| run: cd gamey && cargo llvm-cov --lcov --output-path lcov.info | |
| - name: Normalize Rust coverage paths | |
| run: | | |
| sed -i "s|SF:${GITHUB_WORKSPACE}/|SF:|g" gamey/lcov.info | |
| grep '^SF:' gamey/lcov.info | head | |
| - name: Analyze with SonarQube | |
| uses: SonarSource/sonarqube-scan-action@master | |
| env: | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| with: | |
| args: > | |
| -Dsonar.projectKey=Arquisoft_yovi_es1a | |
| -Dsonar.organization=arquisoft | |
| -Dsonar.javascript.lcov.reportPaths=webapp/coverage/lcov.info,users/coverage/lcov.info,multiplayer/coverage/lcov.info | |
| -Dsonar.rust.lcov.reportPaths=gamey/lcov.info | |
| -Dsonar.sources=webapp/src,users/src,gamey/src,multiplayer/src | |
| -Dsonar.tests=webapp,users,gamey,multiplayer | |
| -Dsonar.test.inclusions=**/*.test.tsx,**/*.test.ts,**/*.test.js,**/*.spec.ts,**/__tests__/**,**/__test__/** | |
| -Dsonar.exclusions=webapp/src/recursos/messages.ts,**/node_modules/**,**/dist/** |