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@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: { persist-credentials: false } - uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.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@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: { persist-credentials: false } - uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0 with: node-version-file: '.nvmrc' - run: npm ci - run: npm run build - name: artifacts/maputnik uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: maputnik path: dist # Build and upload desktop CLI artifacts - name: Set up Go uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.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@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: maputnik-linux path: ./desktop/bin/linux/ - name: Artifacts/darwin uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: maputnik-darwin path: ./desktop/bin/darwin/ - name: Artifacts/windows uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 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@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 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@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: { persist-credentials: false } - run: npm ci - name: Cypress run uses: cypress-io/github-action@b8ba51a856ba5f4c15cf39007636d4ab04f23e3c # v6.10.2 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@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: { persist-credentials: false } - run: npm ci - name: Cypress run uses: cypress-io/github-action@b8ba51a856ba5f4c15cf39007636d4ab04f23e3c # v6.10.2 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