Skip to content

chore(deps-dev): bump @typescript-eslint/eslint-plugin in /ui (#374) #938

chore(deps-dev): bump @typescript-eslint/eslint-plugin in /ui (#374)

chore(deps-dev): bump @typescript-eslint/eslint-plugin in /ui (#374) #938

Workflow file for this run

name: Go
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
test:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || (!github.event.pull_request.draft && !contains(github.event.pull_request.title, 'WIP'))
permissions:
contents: write
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version-file: 'go.mod'
cache: false
- uses: actions/cache@v5
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-gomod-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-gomod-
- name: Install maptool pipeline tools
run: |
sudo apt-get update -qq
sudo apt-get install -y -qq gdal-bin python3-gdal tippecanoe >/dev/null
PMTILES_VERSION=1.27.1
curl -sL "https://github.com/protomaps/go-pmtiles/releases/download/v${PMTILES_VERSION}/go-pmtiles_${PMTILES_VERSION}_Linux_x86_64.tar.gz" \
| sudo tar -xz -C /usr/local/bin pmtiles
pmtiles version
gdal_translate --version
tippecanoe --version
- name: Run tests
run: |
mkdir -p "$GOTMPDIR"
go test -coverprofile=cover.raw -coverpkg=./cmd/...,./internal/... ./...
env:
GOTMPDIR: ${{ runner.temp }}/go-work
TMPDIR: ${{ runner.temp }}
- name: Deduplicate coverage profile
run: |
head -1 cover.raw > cover.out
tail -n +2 cover.raw | sort | python3 -c "
import sys
from collections import defaultdict
entries = defaultdict(lambda: (0, 0))
for line in sys.stdin:
parts = line.strip().rsplit(' ', 2)
if len(parts) == 3:
key, stmts, count = parts[0], int(parts[1]), int(parts[2])
old_s, old_c = entries[key]
entries[key] = (max(stmts, old_s), max(count, old_c))
for key in sorted(entries):
s, c = entries[key]
print(f'{key} {s} {c}')
" >> cover.out
- name: Build
run: go build -o ocap-webserver ./cmd/ocap-webserver
- name: Archive code coverage results
uses: actions/upload-artifact@v7
with:
name: code-coverage
path: cover.out
- name: Download artifact (main.breakdown)
id: download-main-breakdown
uses: dawidd6/action-download-artifact@v20
if: github.event_name == 'pull_request'
with:
branch: main
workflow_conclusion: success
name: main.breakdown
if_no_artifact_found: warn
- name: Check test coverage
id: coverage
uses: vladopajic/go-test-coverage/action/source@v2
with:
profile: cover.out
git-token: ${{ github.ref_name == 'main' && secrets.GITHUB_TOKEN || '' }}
git-branch: badges
breakdown-file-name: ${{ github.ref_name == 'main' && 'main.breakdown' || '' }}
diff-base-breakdown-file-name: ${{ steps.download-main-breakdown.outputs.found_artifact == 'true' && 'main.breakdown' || '' }}
- name: Upload artifact (main.breakdown)
uses: actions/upload-artifact@v7
if: github.ref_name == 'main'
with:
name: main.breakdown
path: main.breakdown
if-no-files-found: error
code_coverage:
name: "Code coverage report"
if: github.event_name == 'pull_request' && !github.event.pull_request.draft
runs-on: ubuntu-latest
needs: test
permissions:
contents: read
actions: read
pull-requests: write
steps:
- uses: fgrosse/go-coverage-report@v1.3.0
with:
coverage-artifact-name: "code-coverage"
coverage-file-name: "cover.out"