File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : PR pipeline
2+
3+ on :
4+ pull_request :
5+ branches :
6+ - develop
7+
8+ env :
9+ IMAGE_NAME : hsldevcom/hsl-map-server
10+ TEST_STAGE : tester
11+ PRODUCTION_STAGE : production
12+
13+ jobs :
14+ build-check-test :
15+ name : Build, check, test
16+ runs-on : ubuntu-latest
17+ steps :
18+ - name : Checkout
19+ uses : actions/checkout@v4
20+ with :
21+ clean : ' true'
22+ fetch-depth : 2
23+
24+ - name : Install Node
25+ uses : actions/setup-node@v4
26+ with :
27+ node-version : " lts/*"
28+ cache : " yarn"
29+
30+ - name : Install dependencies
31+ run : yarn install --frozen-lockfile
32+
33+ - name : Lowercase Docker Image Name
34+ run : echo "IMAGE_NAME=${IMAGE_NAME,,}" >> "${GITHUB_ENV}"
35+
36+ - name : Setup Docker Buildx
37+ uses : docker/setup-buildx-action@v3
38+
39+ - name : Build tester image
40+ uses : docker/build-push-action@v6
41+ with :
42+ context : .
43+ load : true
44+ target : " ${{ env.TEST_STAGE }}"
45+ tags : " ${{ env.IMAGE_NAME }}:${{ env.TEST_STAGE }}"
46+
47+ - name : Run checks and tests inside Docker
48+ run : docker run --rm "${{ env.IMAGE_NAME }}:${{ env.TEST_STAGE }}"
Original file line number Diff line number Diff line change 1- FROM node:16-bullseye-slim
1+ FROM node:16-bullseye-slim AS base
22
33ENV WORK=/opt/hsl-map-server
44ENV DATA_DIR=${WORK}/data
@@ -27,6 +27,13 @@ RUN yarn install && yarn cache clean
2727
2828COPY . ${WORK}
2929
30+ # tester stage: run linting; exits non-zero on failures
31+ FROM base AS tester
32+ RUN yarn eslint .
33+
34+ # production stage: download map data and run the server
35+ FROM base AS production
36+
3037RUN mkdir -p ${DATA_DIR}
3138
3239# OpenMapTiles dataset generated by hsldevcom
You can’t perform that action at this time.
0 commit comments