name: ci on: pull_request: branches: [ main ] push: branches: [ main ] jobs: build-node: name: "build on ${{ matrix.os }}" runs-on: ${{ matrix.os }} permissions: contents: read if: ${{ github.event_name == 'push' || github.event_name == 'pull_request' }} strategy: fail-fast: false matrix: os: [ ubuntu-latest, windows-latest, macos-latest ] steps: - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: { persist-credentials: false } - uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 with: node-version-file: '.nvmrc' - run: npm ci - run: npm run build - run: npm run lint - run: npm run lint-css build-artifacts: name: "build artifacts" runs-on: ubuntu-latest permissions: contents: read if: ${{ github.event_name == 'push' || github.event_name == 'pull_request' }} steps: - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: { persist-credentials: false } - uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 with: node-version-file: '.nvmrc' - run: npm ci - run: npm run build - name: artifacts/maputnik uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 with: name: maputnik path: dist # Build and upload desktop CLI artifacts - name: Set up Go uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0 with: go-version: ^1.23.x cache-dependency-path: desktop/go.sum id: go - name: Build desktop artifacts run: npm run build-desktop - name: Artifacts/linux uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 with: name: maputnik-linux path: ./desktop/bin/linux/ - name: Artifacts/darwin uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 with: name: maputnik-darwin path: ./desktop/bin/darwin/ - name: Artifacts/windows uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 with: name: maputnik-windows path: ./desktop/bin/windows/ unit-tests: name: "Unit tests" runs-on: ubuntu-latest permissions: contents: read steps: - name: Checkout uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: { persist-credentials: false } - run: npm ci - run: npm run test-unit-ci - name: Upload coverage reports to Codecov uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1 with: files: ${{ github.workspace }}/coverage/coverage-final.json verbose: true e2e-tests: name: "E2E tests using chrome" runs-on: ubuntu-latest permissions: contents: read steps: - name: Checkout uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: { persist-credentials: false } - run: npm ci - name: Cypress run uses: cypress-io/github-action@7ef72e250a9e564efb4ed4c2433971ada4cc38b4 # v6.10.4 with: build: npm run build start: npm run start browser: chrome - name: Upload coverage reports to Codecov uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1 with: files: ${{ github.workspace }}/.nyc_output/out.json verbose: true e2e-tests-docker: name: "E2E tests using chrome and docker" runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: { persist-credentials: false } - run: npm ci - name: Cypress run uses: cypress-io/github-action@7ef72e250a9e564efb4ed4c2433971ada4cc38b4 # v6.10.4 with: build: docker build -t maputnik . start: docker run --rm --network host maputnik --port=8888 browser: chrome - name: Upload coverage reports to Codecov uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1 with: files: ${{ github.workspace }}/.nyc_output/out.json verbose: true