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+
12+ jobs :
13+ build-check-test :
14+ name : Build, check, test
15+ runs-on : ubuntu-latest
16+ steps :
17+ - name : Checkout
18+ uses : actions/checkout@v4
19+ with :
20+ clean : ' true'
21+ fetch-depth : 2
22+
23+ - name : Lowercase Docker Image Name
24+ run : echo "IMAGE_NAME=${IMAGE_NAME,,}" >> "${GITHUB_ENV}"
25+
26+ - name : Setup Docker Buildx
27+ uses : docker/setup-buildx-action@v3
28+
29+ - name : Build tester image
30+ uses : docker/build-push-action@v6
31+ with :
32+ context : .
33+ load : true
34+ target : " ${{ env.TEST_STAGE }}"
35+ tags : " ${{ env.IMAGE_NAME }}:${{ env.TEST_STAGE }}"
36+
37+ - name : Run checks and tests inside Docker
38+ 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,14 @@ RUN yarn install && yarn cache clean
2727
2828COPY . ${WORK}
2929
30+ # tester stage: install devDependencies and run linting; exits non-zero on failures
31+ FROM base AS tester
32+ RUN NODE_ENV=development yarn install && yarn cache clean
33+ RUN node_modules/.bin/eslint .
34+
35+ # production stage: download map data and run the server
36+ FROM base AS production
37+
3038RUN mkdir -p ${DATA_DIR}
3139
3240# OpenMapTiles dataset generated by hsldevcom
You can’t perform that action at this time.
0 commit comments