forked from hiddewie/OpenRailwayMap-vector
-
Notifications
You must be signed in to change notification settings - Fork 0
164 lines (134 loc) · 4.74 KB
/
Copy pathtest.yml
File metadata and controls
164 lines (134 loc) · 4.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
name: Test
on:
workflow_dispatch: ~
push:
branches:
- master
pull_request: ~
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref_name != 'master' }}
jobs:
test:
name: Build and test
strategy:
matrix:
runs-on:
- ubuntu-24.04
- ubuntu-24.04-arm
fail-fast: false
runs-on: ${{ matrix.runs-on }}
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-node@v6
with:
node-version: 24
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get Date
id: get-date
shell: bash
run: |
echo "date=$(/bin/date -u "+%Y%m")" >> $GITHUB_OUTPUT
- name: Cache data
uses: actions/cache@v4
id: cache-data
with:
path: |
data/berlin.osm.pbf
data/filtered/berlin.osm.pbf
key: data-${{ steps.get-date.outputs.date }}-berlin
enableCrossOsArchive: true
- name: Download Berlin
if: ${{ steps.cache-data.outputs.cache-hit != 'true' }}
run: |
curl --location --fail --output data/berlin.osm.pbf https://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf
- name: Build containers
uses: docker/bake-action@v6
with:
load: true
targets: db,import,import-test,api,martin,proxy
set: |
db.cache-from=type=gha,scope=db-${{ runner.arch }}
${{ github.ref_name == 'master' && format('db.cache-to=type=gha,mode=max,scope=db-{0}', runner.arch) || '' }}
import.cache-from=type=gha,scope=import-${{ runner.arch }}
${{ github.ref_name == 'master' && format('import.cache-to=type=gha,mode=max,scope=import-{0}', runner.arch) || '' }}
import-test.cache-from=type=gha,scope=import-test-${{ runner.arch }}
${{ github.ref_name == 'master' && format('import-test.cache-to=type=gha,mode=max,scope=import-test-{0}', runner.arch) || '' }}
api.cache-from=type=gha,scope=api-${{ runner.arch }}
${{ github.ref_name == 'master' && format('api.cache-to=type=gha,mode=max,scope=api-{0}', runner.arch) || '' }}
martin.cache-from=type=gha,scope=martin-${{ runner.arch }}
${{ github.ref_name == 'master' && format('martin.cache-to=type=gha,mode=max,scope=martin-{0}', runner.arch) || '' }}
proxy.cache-from=type=gha,scope=proxy-${{ runner.arch }}
${{ github.ref_name == 'master' && format('proxy.cache-to=type=gha,mode=max,scope=proxy-{0}', runner.arch) || '' }}
- name: Start database
run: |
docker compose up --wait db
- name: Run import tests
run: |
docker compose run --rm import-test
- name: Import data
env:
OSM2PGSQL_DATAFILE: berlin.osm.pbf
run: |
docker compose run --rm --no-deps import import
- name: Start API
run: |
docker compose up --wait --no-deps api
- name: Run API tests
run: |
docker compose run --no-deps api-test
- name: Start tile server
run: |
docker compose up --detach --no-deps martin
- name: Start proxy
run: |
docker compose up --wait --no-deps proxy
- name: Run proxy tests
run: |
docker compose run --no-deps proxy-test
- name: Download preset
if: always()
run: |
curl -sSf -o preset.zip http://localhost:8000/preset.zip
- name: Store preset
uses: actions/upload-artifact@v6
if: always()
with:
name: ${{ runner.arch }}-presets
path: preset.zip
if-no-files-found: warn
- name: Run UI tests
uses: cypress-io/github-action@v7
with:
working-directory: proxy/test/ui
browser: firefox
- name: Store screenshots
uses: actions/upload-artifact@v6
if: always()
with:
name: ${{ runner.arch }}-screenshots
path: proxy/test/ui/cypress/screenshots
if-no-files-found: warn
- name: Print logs
if: always()
run: |
docker compose logs
feature-test:
name: Feature test
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Run feature tests
run: |
docker compose run --rm --build feature-test