284 lines
6.8 KiB
YAML
284 lines
6.8 KiB
YAML
name: Test
|
|
|
|
on:
|
|
push:
|
|
branches-ignore:
|
|
- 'phillip/**'
|
|
- 'sabrecat/**'
|
|
- 'kalista/**'
|
|
- 'natalie/**'
|
|
pull_request:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
node-version: [21.x]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 1
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
- run: sudo apt update
|
|
- run: sudo apt -y install libkrb5-dev
|
|
- run: cp config.json.example config.json
|
|
- name: npm install
|
|
run: |
|
|
npm i
|
|
env:
|
|
CI: true
|
|
NODE_ENV: test
|
|
- run: npm run lint-no-fix
|
|
apidoc:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
node-version: [21.x]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 1
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
- run: sudo apt update
|
|
- run: sudo apt -y install libkrb5-dev
|
|
- run: cp config.json.example config.json
|
|
- name: npm install
|
|
run: |
|
|
npm i
|
|
env:
|
|
CI: true
|
|
NODE_ENV: test
|
|
- run: npm run apidoc
|
|
sanity:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
node-version: [21.x]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 1
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
- run: sudo apt update
|
|
- run: sudo apt -y install libkrb5-dev
|
|
- run: cp config.json.example config.json
|
|
- name: npm install
|
|
run: |
|
|
npm i
|
|
env:
|
|
CI: true
|
|
NODE_ENV: test
|
|
- run: npm run test:sanity
|
|
|
|
common:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
node-version: [21.x]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 1
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
- run: sudo apt update
|
|
- run: sudo apt -y install libkrb5-dev
|
|
- run: cp config.json.example config.json
|
|
- name: npm install
|
|
run: |
|
|
npm i
|
|
env:
|
|
CI: true
|
|
NODE_ENV: test
|
|
- run: npm run test:common
|
|
content:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
node-version: [21.x]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 1
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
- run: sudo apt update
|
|
- run: sudo apt -y install libkrb5-dev
|
|
- run: cp config.json.example config.json
|
|
- name: npm install
|
|
run: |
|
|
npm i
|
|
env:
|
|
CI: true
|
|
NODE_ENV: test
|
|
- run: npm run test:content
|
|
|
|
api-unit:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
node-version: [21.x]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 1
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
|
|
- name: Start MongoDB 7.0 Replica Set
|
|
run: |
|
|
docker run -d --name mongodb -p 27017:27017 mongo:7.0 --replSet rs
|
|
sleep 5
|
|
docker exec mongodb mongosh --quiet --eval "rs.initiate({_id: 'rs', members: [{_id: 0, host: 'localhost:27017'}]})"
|
|
sleep 3
|
|
|
|
- run: sudo apt update
|
|
- run: sudo apt -y install libkrb5-dev
|
|
- run: cp config.json.example config.json
|
|
- name: npm install
|
|
run: |
|
|
npm i
|
|
env:
|
|
CI: true
|
|
NODE_ENV: test
|
|
|
|
- run: npm run test:api:unit
|
|
env:
|
|
REQUIRES_SERVER=true: true
|
|
|
|
api-v3-integration:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
node-version: [21.x]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 1
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
- name: Start MongoDB 7.0 Replica Set
|
|
run: |
|
|
docker run -d --name mongodb -p 27017:27017 mongo:7.0 --replSet rs
|
|
sleep 5
|
|
docker exec mongodb mongosh --quiet --eval "rs.initiate({_id: 'rs', members: [{_id: 0, host: 'localhost:27017'}]})"
|
|
sleep 3
|
|
|
|
- run: sudo apt update
|
|
- run: sudo apt -y install libkrb5-dev
|
|
- run: cp config.json.example config.json
|
|
- name: npm install
|
|
run: |
|
|
npm i
|
|
env:
|
|
CI: true
|
|
NODE_ENV: test
|
|
|
|
- run: npm run test:api-v3:integration
|
|
env:
|
|
REQUIRES_SERVER=true: true
|
|
|
|
api-v4-integration:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
node-version: [21.x]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 1
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
- name: Start MongoDB 7.0 Replica Set
|
|
run: |
|
|
docker run -d --name mongodb -p 27017:27017 mongo:7.0 --replSet rs
|
|
sleep 5
|
|
docker exec mongodb mongosh --quiet --eval "rs.initiate({_id: 'rs', members: [{_id: 0, host: 'localhost:27017'}]})"
|
|
sleep 3
|
|
|
|
- run: sudo apt update
|
|
- run: sudo apt -y install libkrb5-dev
|
|
- run: cp config.json.example config.json
|
|
- name: npm install
|
|
run: |
|
|
npm i
|
|
env:
|
|
CI: true
|
|
NODE_ENV: test
|
|
|
|
- run: npm run test:api-v4:integration
|
|
env:
|
|
REQUIRES_SERVER=true: true
|
|
|
|
client-unit:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
node-version: [21.x]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 1
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
- run: sudo apt update
|
|
- run: sudo apt -y install libkrb5-dev
|
|
- run: cp config.json.example config.json
|
|
- name: npm install
|
|
run: |
|
|
npm i
|
|
env:
|
|
CI: true
|
|
NODE_ENV: test
|
|
- run: npm run test:unit
|
|
working-directory: ./website/client
|
|
|
|
production-build:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
node-version: [21.x]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 1
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
- run: sudo apt update
|
|
- run: sudo apt -y install libkrb5-dev
|
|
- run: cp config.json.example config.json
|
|
- name: npm install
|
|
run: |
|
|
npm install
|
|
env:
|
|
CI: true
|
|
NODE_ENV: production
|