More info about attribution #503
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
name: Continuous integration | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
actionlint: | |
name: Lint GitHub Actions workflows | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
permissions: | |
contents: read | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Check workflow files | |
run: | | |
echo "::add-matcher::.github/actionlint-matcher.json" | |
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) | |
./actionlint -color | |
shell: bash | |
maplibre-style-validate: | |
name: Validate MapLibre style specifications | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
permissions: | |
contents: read | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install maplibre-gl-style-spec | |
run: npm install @maplibre/maplibre-gl-style-spec --global | |
- name: Validate MapLibre GL styles | |
run: | | |
find vector/styles -name "style.json" -type f -exec bash -c 'echo "Validating file: $1" && gl-style-validate "$1"' - {} \; | |
test-vector-basemap: | |
name: Run vector basemap tests | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
permissions: | |
contents: read | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Prepare Java environment | |
uses: ./.github/actions/prepare-java-environment | |
- name: Run tests | |
run: ./gradlew test -i | |
publish-preivew-page: | |
name: Generate preview page | |
permissions: | |
contents: read | |
deployments: write | |
uses: ./.github/workflows/reusable-workflow-publish-page.yml | |
with: | |
style-source-url: https://dev-vector.startupgov.lt/tile.json | |
style-base-url: https://${{ github.head_ref || github.ref_name }}.national-basemap.pages.dev | |
pmtiles-url: https://dev-cdn.startupgov.lt/tiles/vector/pmtiles/lithuania.pmtiles | |
secrets: | |
cloudflare-api-token: ${{ secrets.CLOUDFLARE_PAGES_API_TOKEN }} | |
cloudflare-account-id: ${{ secrets.CLOUDFLARE_PAGES_ACCOUNT_ID }} | |
generate-vector-basemap-pmtiles: | |
name: Generate vector basemap PMTiles | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
if: github.event_name != 'push' | |
permissions: | |
contents: read | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Generate vector basemap PMTiles | |
uses: ./.github/actions/basemap-vector-generate-pmtiles | |
with: | |
artifact-retention-days: ${{ github.ref == 'refs/heads/main' && 30 || 7 }} | |
pull-request-comment-planetiler-statistics: | |
name: Add Planetiler statistics to pull request | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
if: github.event_name == 'pull_request' | |
needs: generate-vector-basemap-pmtiles | |
permissions: | |
contents: read | |
pull-requests: write | |
steps: | |
- name: Download logs | |
uses: actions/download-artifact@v4 | |
with: | |
name: logs-planetiler-basemap-vector | |
merge-multiple: true | |
- name: Extract only required statistics | |
run: sed -n '/Tile stats/,$p' logs-planetiler-basemap-vector.txt | tr -cd '[:print:]\n\r' > tile-stats.txt | |
- name: Prepare comment body | |
run: | | |
cat << EOF > comment-body.txt | |
\`\`\` | |
$(cat tile-stats.txt) | |
\`\`\` | |
EOF | |
- name: Comment pull request | |
uses: thollander/actions-comment-pull-request@v2 | |
with: | |
comment_tag: tile-stats | |
filePath: comment-body.txt | |
- name: Add summary | |
run: cat comment-body.txt >> "$GITHUB_STEP_SUMMARY" |