Fix issue #27: Add frontend testing
All checks were successful
Test / test (push) Successful in 1s
All checks were successful
Test / test (push) Successful in 1s
This commit is contained in:
31
.gitea/workflows/test.yml
Normal file
31
.gitea/workflows/test.yml
Normal file
@@ -0,0 +1,31 @@
|
||||
name: Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ['**']
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: docker
|
||||
|
||||
steps:
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node
|
||||
run: |
|
||||
# The suite runs on Node's built-in test runner and needs Node 18+. The container the
|
||||
# docker runner starts jobs in is not guaranteed to ship one, so fall back to the
|
||||
# official LTS tarball. The tests themselves install no dependencies.
|
||||
if node -e 'process.exit(Number(process.versions.node.split(".")[0]) >= 18 ? 0 : 1)' 2>/dev/null; then
|
||||
node --version
|
||||
else
|
||||
apt-get update -y && apt-get install -y curl ca-certificates xz-utils
|
||||
curl -fsSL https://nodejs.org/dist/v22.12.0/node-v22.12.0-linux-x64.tar.xz -o /tmp/node.tar.xz
|
||||
tar -xJf /tmp/node.tar.xz -C /usr/local --strip-components=1
|
||||
node --version
|
||||
fi
|
||||
|
||||
- name: Run tests
|
||||
run: npm test
|
||||
Reference in New Issue
Block a user