-
Notifications
You must be signed in to change notification settings - Fork 1
76 lines (74 loc) · 2.7 KB
/
build.yml
File metadata and controls
76 lines (74 loc) · 2.7 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
name: build
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
permissions:
id-token: write
pages: write
steps:
- uses: actions/checkout@v6
- name: Disable AppArmor # https://github.com/puppeteer/puppeteer/issues/12818
run: echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v6
with:
node-version: 24
- name: Install dependencies
run: npm install
- name: Analysing the code with prettier
run: npm run prettier-check
- name: Run tests with coverage
run: npx nyc --reporter=lcov npm test
- name: Use Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: 3.14
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pylint
pip install pytest
pip install pytest-cov
pip install -r requirements.txt
- name: Analysing the code with pylint
run: pylint $(git ls-files '*.py')
- name: Run tests with coverage
run: python -m pytest --cov --cov-branch --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
- name: Generate places.geojson
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref == 'refs/heads/main')
run: |
python -c "
import os
import random
import time
def random_ip():
return '.'.join(str(random.randint(0, 255)) for _ in range(4))
ips = [random_ip() for _ in range(420)]
for ip in ips:
time.sleep(1.5) # Ratelimit 45 request / minute
os.system(f'python ./script/fail2ban_map.py add {ip}')
"
- name: Configure Pages
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref == 'refs/heads/main')
uses: actions/configure-pages@v5
- name: Upload artifact for deployment
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref == 'refs/heads/main')
uses: actions/upload-pages-artifact@v4
with:
path: ./public
- name: Deploy to GitHub Pages
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref == 'refs/heads/main')
uses: actions/deploy-pages@v4