Skip to content

Commit d76478f

Browse files
committed
WEB: Add a Github Actions CI check
1 parent 7f6baf1 commit d76478f

File tree

3 files changed

+45
-1
lines changed

3 files changed

+45
-1
lines changed

.github/workflows/ci.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Web CI
2+
on: [push, pull_request]
3+
permissions:
4+
contents: read
5+
jobs:
6+
build:
7+
name: Check
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Install glue
11+
# Patch Glue to let it run on modern OS
12+
run: |
13+
sudo apt install -y glue-sprite && \
14+
sudo ln -s glue-sprite /usr/bin/glue && \
15+
sudo sed -i -e 's/PILImage\.ANTIALIAS/PILImage.LANCZOS/' /usr/lib/python3/dist-packages/glue/formats/img.py && \
16+
sudo sed -i -e 's/re\.compile(/re.compile(r/' /usr/lib/python3/dist-packages/glue/core.py && \
17+
sudo sed -i -e 's/PImage\.VERSION/PImage.__version__/' /usr/lib/python3/dist-packages/glue/bin.py
18+
- uses: actions/checkout@v4
19+
- name: Validate composer.json and composer.lock
20+
run: composer validate --strict
21+
- name: Setup
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: ${{ matrix.node-version }}
25+
- name: Cache Composer packages
26+
id: packages-cache
27+
uses: actions/cache@v4
28+
with:
29+
path: "vendor\nnode_modules\ndumper-companion/node_modules"
30+
key: ${{ runner.os }}-phpjs-${{ hashFiles('**/composer.lock', '**/package-lock.json') }}
31+
restore-keys: |
32+
${{ runner.os }}-phpjs-
33+
- name: Install dependencies
34+
run: composer install --prefer-dist --no-progress
35+
- name: Run CI checks
36+
run: composer run-script ci

composer.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,13 @@
4949
"@build-common",
5050
"npm install"
5151
],
52+
"ci": [
53+
"composer install",
54+
"@build-common",
55+
"@lint",
56+
"npm ci",
57+
"npm run lint"
58+
],
5259
"start": [
5360
"Composer\\Config::disableProcessTimeout",
5461
"php -S localhost:8000 -t ./public_html ./public_html/index.php"

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
},
1010
"scripts": {
1111
"postinstall": "(cd dumper-companion && npm ci --omit=dev && npm run build) && node build.js",
12-
"scss:watch": "sass --watch ./scss:./public_html/css"
12+
"scss:watch": "sass --watch ./scss:./public_html/css",
13+
"lint": "(cd dumper-companion && npm ci && npm run lint)"
1314
}
1415
}

0 commit comments

Comments
 (0)