Skip to content

Commit e1710c5

Browse files
DennisOSRMCopilot
andauthored
ci: add GitHub Actions workflow for linting, building, and testing (#402)
* ci: add GitHub Actions workflow for linting, building, and testing - Run on pull requests and pushes to gh-pages/main branches - Test against Node 18.x and 20.x - Steps: lint (eslint), build (webpack), test (jest) - Use npm ci for reproducible dependency installation - Cache npm dependencies for faster builds Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * ci: update Node.js versions to 22, 24, and latest - Changed matrix from 18.x, 20.x to 22.x, 24.x, and latest - Ensures testing with modern Node.js releases Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * ci: add eslint dependency and update configuration - Add eslint to devDependencies - Update .eslintrc to use modern rule names (keyword-spacing instead of space-after-keywords) - Add parserOptions for ES2021 compatibility - Fix code formatting issues: indentation, spacing, brace style - Add eslint-disable comments for intentional null comparisons in polyfill All linting checks now pass with 'npm run test:lint' Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * ci: fix workflow trigger scope and address review feedback - Add branches filter to pull_request trigger (gh-pages, main) - Ensures CI only runs on PRs targeting these branches - ESLint dependency added in separate commit (f1608f7) Addresses review feedback on PR #402 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 1771d15 commit e1710c5

19 files changed

Lines changed: 1848 additions & 130 deletions

.eslintrc

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
{
22
"env": {
33
"node": true,
4-
"browser": true
4+
"browser": true,
5+
"es2021": true
6+
},
7+
"parserOptions": {
8+
"ecmaVersion": 2021,
9+
"sourceType": "module"
510
},
611
"globals": {
712
"L": true
@@ -10,7 +15,7 @@
1015
"indent": [2, 2],
1116
"comma-dangle": [2, "never"],
1217
"space-before-blocks": 2,
13-
"space-after-keywords": 2,
18+
"keyword-spacing": 2,
1419
"space-unary-ops": 2,
1520
"no-use-before-define": [2, "nofunc"],
1621
"camelcase": 0,

.github/workflows/ci.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: CI Checks
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- gh-pages
7+
- main
8+
push:
9+
branches:
10+
- gh-pages
11+
- main
12+
13+
jobs:
14+
lint-and-test:
15+
runs-on: ubuntu-latest
16+
17+
strategy:
18+
matrix:
19+
node-version: [22.x, 24.x, latest]
20+
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@v4
24+
25+
- name: Setup Node.js ${{ matrix.node-version }}
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version: ${{ matrix.node-version }}
29+
cache: 'npm'
30+
31+
- name: Install dependencies
32+
run: npm ci
33+
34+
- name: Run linting
35+
run: npm run test:lint
36+
37+
- name: Build code
38+
run: npm run build
39+
40+
- name: Run tests
41+
run: npm test

i18n/da.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ module.exports = {
1515
'Via point - press enter to drop marker': 'Via - tryk for at placere delmålspunkt',
1616
'Bike': 'Cykel',
1717
'Car': 'Bil',
18-
'Foot': 'Til fods',
18+
'Foot': 'Til fods'
1919
};

i18n/de.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ module.exports = {
1515
'Via point - press enter to drop marker': 'Zwischenstop - drücken um einen Marker zu plazieren',
1616
'Bike': 'Fahrrad',
1717
'Car': 'Auto',
18-
'Foot': 'Fussgänger',
18+
'Foot': 'Fussgänger'
1919
};

i18n/en.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ module.exports = {
1515
'Via point - press enter to drop marker': 'Via point - press enter to drop marker',
1616
'Bike': 'Bike',
1717
'Car': 'Car',
18-
'Foot': 'Foot',
18+
'Foot': 'Foot'
1919
};

i18n/es.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ module.exports = {
1515
'Via point - press enter to drop marker': 'Punto en la vía - presione enter para colocar un marcador',
1616
'Bike': 'Bicicleta',
1717
'Car': 'Coche',
18-
'Foot': 'Peatón',
18+
'Foot': 'Peatón'
1919
};

i18n/fr.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ module.exports = {
1515
'Via point - press enter to drop marker': 'Étape intermédiaire - appuyez sur Entrée pour placer le marqueur',
1616
'Bike': 'Vélo',
1717
'Car': 'Voiture',
18-
'Foot': 'Piéton',
18+
'Foot': 'Piéton'
1919
};

i18n/it.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ module.exports = {
1515
'Via point - press enter to drop marker': 'Punto di passaggio - premere invio per rilasciare un marcatore',
1616
'Bike': 'Bicicletta',
1717
'Car': 'Auto',
18-
'Foot': 'A piedi',
18+
'Foot': 'A piedi'
1919
};

0 commit comments

Comments
 (0)