Skip to content

Commit 03bc4a2

Browse files
committed
update test environment
1 parent 6f1d10e commit 03bc4a2

9 files changed

Lines changed: 979 additions & 676 deletions

File tree

.eslintignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

.eslintrc.json

Lines changed: 0 additions & 36 deletions
This file was deleted.

.github/workflows/test.yml

Lines changed: 63 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -3,65 +3,66 @@ name: Package Tests
33
on: [push, pull_request]
44

55
jobs:
6-
npm:
7-
name: "@wq/${{ matrix.package }}"
8-
runs-on: ubuntu-20.04
9-
env:
10-
PACKAGE: ${{ matrix.package }}
11-
strategy:
12-
fail-fast: false
13-
matrix:
14-
python-version: ["3.10"]
15-
node-version: [18]
16-
package:
17-
- map
18-
- map-gl
19-
- map-gl-web
20-
- map-gl-native
21-
steps:
22-
- uses: actions/checkout@v2
23-
with:
24-
fetch-depth: 0
25-
- name: Set up Node ${{ matrix.node-version }}
26-
uses: actions/setup-node@v2
27-
with:
28-
node-version: ${{ matrix.node-version }}
29-
- name: Set up Python ${{ matrix.python-version }}
30-
uses: actions/setup-python@v2
31-
with:
32-
python-version: ${{ matrix.python-version }}
33-
- name: Install dependencies
34-
run: |
35-
echo "@wq:registry=https://npm.pkg.github.com/wq" > .npmrc
36-
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> .npmrc
37-
npm ci && npm run build
38-
- name: Install native dependencies
39-
if: matrix.package == 'map-gl-native'
40-
run: |
41-
cd packages/$PACKAGE
42-
echo "@wq:registry=https://npm.pkg.github.com/wq" > .npmrc
43-
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> .npmrc
44-
npm ci
45-
- name: Lint with ESLint
46-
run: npm run lint
47-
- name: Start test server
48-
run: python -m tests.server &
49-
- name: Test with Jest
50-
run: |
51-
cd packages/$PACKAGE
52-
npm run test
53-
- uses: smartsquaregmbh/delete-old-packages@v0.4.0
54-
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
55-
with:
56-
keep: 5
57-
names: ${{ matrix.package }}
58-
- name: Publish to Github Packages
59-
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
60-
run: |
61-
python -m pip install setuptools_scm
62-
./set_dev_version.sh
63-
echo "registry=https://npm.pkg.github.com/wq" > .npmrc
64-
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> .npmrc
65-
cp .npmrc packages/$PACKAGE/.npmrc # for native builds
66-
cd packages/$PACKAGE
67-
npm publish
6+
npm:
7+
name: "@wq/${{ matrix.package }}"
8+
runs-on: ubuntu-latest
9+
env:
10+
PACKAGE: ${{ matrix.package }}
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
python-version: ["3.14"]
15+
node-version: [24]
16+
package:
17+
- map
18+
- map-gl
19+
- map-gl-web
20+
- map-gl-native
21+
steps:
22+
- uses: actions/checkout@v6
23+
with:
24+
fetch-depth: 0
25+
- name: Set up Node ${{ matrix.node-version }}
26+
uses: actions/setup-node@v6
27+
with:
28+
node-version: ${{ matrix.node-version }}
29+
- name: Set up Python ${{ matrix.python-version }}
30+
uses: actions/setup-python@v6
31+
with:
32+
python-version: ${{ matrix.python-version }}
33+
- name: Install dependencies
34+
run: |
35+
echo "@wq:registry=https://npm.pkg.github.com/wq" > .npmrc
36+
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> .npmrc
37+
npm ci && npm run build
38+
- name: Install native dependencies
39+
if: matrix.package == 'map-gl-native'
40+
run: |
41+
cd packages/$PACKAGE
42+
echo "@wq:registry=https://npm.pkg.github.com/wq" > .npmrc
43+
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> .npmrc
44+
npm ci
45+
- name: Lint with ESLint
46+
run: npm run lint
47+
- name: Start test server
48+
run: python -m tests.server &
49+
- name: Test with Jest
50+
run: |
51+
cd packages/$PACKAGE
52+
npm run test
53+
- uses: actions/delete-package-versions@v5
54+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
55+
with:
56+
package-type: npm
57+
package-name: ${{ matrix.package }}
58+
min-versions-to-keep: 5
59+
- name: Publish to Github Packages
60+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
61+
run: |
62+
python -m pip install setuptools_scm
63+
./set_dev_version.sh
64+
echo "registry=https://npm.pkg.github.com/wq" > .npmrc
65+
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> .npmrc
66+
cp .npmrc packages/$PACKAGE/.npmrc # for native builds
67+
cd packages/$PACKAGE
68+
npm publish --tag latest

docs/src/components/Layout.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const theme = {
4646
secondary: "#0088bd",
4747
};
4848

49-
export default function Layout({ children, ...rest }) {
49+
export default function Layout({ children }) {
5050
return (
5151
<Root wq={overrides} theme={theme}>
5252
<Container>

eslint.config.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import js from "@eslint/js";
2+
import globals from "globals";
3+
import pluginReact from "eslint-plugin-react";
4+
import { defineConfig } from "eslint/config";
5+
6+
export default defineConfig([
7+
{
8+
ignores: ["docs/.cache/**", "docs/public/**"],
9+
},
10+
{
11+
files: ["**/*.{js,mjs,cjs,jsx}"],
12+
plugins: { js },
13+
extends: ["js/recommended"],
14+
languageOptions: {
15+
globals: {
16+
...globals.browser,
17+
...globals.jest,
18+
...globals.node,
19+
},
20+
},
21+
rules: {
22+
"react/prop-types": [
23+
2,
24+
{
25+
skipUndeclared: true,
26+
},
27+
],
28+
},
29+
},
30+
pluginReact.configs.flat.recommended,
31+
]);

0 commit comments

Comments
 (0)