Define how much to slice and how much to scale #9562
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: Tests | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| workflow_dispatch: | |
| permissions: | |
| checks: write | |
| pull-requests: write | |
| contents: write | |
| jobs: | |
| code-hygiene: | |
| name: Code Hygiene | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v4 | |
| with: | |
| node-version-file: '.nvmrc' | |
| - run: npm ci | |
| - run: npm run lint | |
| if: '!cancelled()' | |
| - run: npm run lint-css | |
| if: '!cancelled()' | |
| - run: npm run generate-typings | |
| if: '!cancelled()' | |
| - run: npm run typecheck | |
| if: '!cancelled()' | |
| - run: npm run generate-docs | |
| - name: Build docs using docker and mkdocs-material | |
| run: | | |
| rm docs/README.md | |
| rm -rf docs/API/_media | |
| docker run --rm -v ${PWD}:/docs squidfunk/mkdocs-material build --strict | |
| - name: Check spelling | |
| # This need to run after the docs are built | |
| run: npm run spellcheck | |
| unit-tests: | |
| name: Unit tests | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 40 | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v4 | |
| with: | |
| node-version-file: '.nvmrc' | |
| - name: Start display server | |
| run: nohup Xvfb & | |
| echo "DISPLAY=:0" >> $GITHUB_ENV | |
| - run: npm ci | |
| - run: npm run test-unit-ci | |
| - name: Upload coverage artifact | |
| if: '!cancelled()' | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: coverage-reports-unit-tests | |
| path: ${{ github.workspace }}/coverage/vitest/unit/coverage-final.json | |
| retention-days: 1 | |
| - name: Upload test results to Codecov | |
| if: '!cancelled()' | |
| uses: codecov/test-results-action@47f89e9acb64b76debcd5ea40642d25a4adced9f # v1.1.1 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| integration-tests: | |
| name: Integration tests | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| fail-fast: false | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 40 | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v4 | |
| with: | |
| node-version-file: '.nvmrc' | |
| - name: Disable AppArmor | |
| if: runner.os == 'Linux' | |
| run: echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns | |
| - run: npm ci | |
| - run: npm run build-dist | |
| - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| if: '!cancelled()' | |
| with: | |
| name: build-dist-${{ matrix.os }} | |
| path: dist/maplibre-gl.js | |
| - run: npm run test-integration-ci | |
| - name: Move files | |
| if: runner.os == 'Linux' | |
| run: | | |
| mkdir -p ${{ github.workspace }}/upload | |
| mv ${{ github.workspace }}/coverage/vitest/integration/coverage-final.json ${{ github.workspace }}/upload/coverage-final-integration.json | |
| mv ${{ github.workspace }}/coverage/query/coverage-final.json ${{ github.workspace }}/upload/coverage-final-query.json | |
| - name: Upload coverage artifact | |
| if: ${{ !cancelled() && runner.os == 'Linux' }} | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: coverage-reports-integration-tests | |
| path: | | |
| ${{ github.workspace }}/upload/coverage-final-integration.json | |
| ${{ github.workspace }}/upload/coverage-final-query.json | |
| retention-days: 1 | |
| render-tests: | |
| name: Render tests | |
| env: | |
| SPLIT_COUNT: 6 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| split: [0, 1, 2, 3, 4, 5] | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 120 | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v4 | |
| with: | |
| node-version-file: '.nvmrc' | |
| - name: install CJK fonts for local ideographs render tests | |
| if: runner.os == 'Linux' | |
| run: sudo apt install fonts-noto-cjk | |
| - name: Disable AppArmor | |
| if: runner.os == 'Linux' | |
| run: echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns | |
| - run: npm ci | |
| - name: Start display server | |
| if: runner.os == 'Linux' | |
| run: nohup Xvfb & | |
| echo "DISPLAY=:0" >> $GITHUB_ENV | |
| - run: npm run build-dist | |
| - name: Run Render tests | |
| run: npm run test-render | |
| env: | |
| CURRENT_SPLIT_INDEX: ${{ matrix.split }} | |
| - name: Move files | |
| if: runner.os == 'Linux' | |
| run: | | |
| mkdir -p ${{ github.workspace }}/upload | |
| mv ${{ github.workspace }}/coverage/render/coverage-final.json ${{ github.workspace }}/upload/coverage-final-render-${{ matrix.split }}.json | |
| - name: Upload coverage artifact | |
| if: ${{ !cancelled() && runner.os == 'Linux' }} | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: coverage-reports-render-tests-${{ matrix.split }} | |
| path: ${{ github.workspace }}/upload/coverage-final-render-${{ matrix.split }}.json | |
| retention-days: 1 | |
| - name: Upload test results to Codecov | |
| if: '!cancelled()' | |
| uses: codecov/test-results-action@47f89e9acb64b76debcd5ea40642d25a4adced9f # v1.1.1 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| - name: Upload render test failure | |
| if: failure() | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: render-test-report-${{ matrix.os }}-${{ matrix.split }} | |
| path: ${{ github.workspace }}/test/integration/render/results.html | |
| build-tests: | |
| name: Build tests | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v4 | |
| with: | |
| node-version-file: '.nvmrc' | |
| - run: npm ci | |
| - run: npm run build-dist | |
| - run: npm run test-build-ci | |
| merge-and-report: | |
| name: Merge coverage and report | |
| runs-on: ubuntu-latest | |
| needs: [unit-tests, integration-tests, render-tests] | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v4 | |
| with: | |
| node-version-file: '.nvmrc' | |
| - name: Download coverage reports | |
| uses: actions/download-artifact@4a24838f3d5601fd639834081e118c2995d51e1c | |
| with: | |
| pattern: coverage-reports-* | |
| merge-multiple: true | |
| path: downloaded | |
| - name: Merge Coverage reports | |
| shell: bash | |
| run: npx nyc report -t ${{ github.workspace }}/downloaded --reporter lcov --reporter json --report-dir coverage-merged | |
| - name: Upload merged coverage report | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: merged-coverage-report | |
| path: coverage-merged | |
| - name: Code Coverage Annotation | |
| if: github.event.pull_request.head.repo.full_name == github.repository | |
| uses: ggilder/codecoverage@055ea578470d7704a861d9a7498fc55810925521 | |
| with: | |
| GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
| COVERAGE_FILE_PATH: "./coverage-merged/lcov.info" | |
| COVERAGE_FORMAT: "lcov" | |
| - name: Upload coverage reports to Codecov | |
| uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1 | |
| with: | |
| files: ${{ github.workspace }}/coverage-merged/coverage-final.json | |
| verbose: true | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| disable_search: true |