Files
habitica/.github/workflows/test.yml
T
2023-05-30 23:52:59 +02:00

222 lines
5.3 KiB
YAML

name: Test
on: [push, pull_request]
permissions:
contents: read
jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Setup Shared Job Steps
uses: './.github/actions/shared-job-steps'
with:
node-version: ${{ matrix.node-version }}
node-env: 'test'
package-install-cmd: 'ci --ignore-scripts'
install-website-package: 'true'
website-package-install-cmd: 'ci --ignore-scripts'
- run: npm run lint-no-fix
apidoc:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Setup Shared Job Steps
uses: './.github/actions/shared-job-steps'
with:
node-version: ${{ matrix.node-version }}
node-env: 'test'
package-install-cmd: 'ci --ignore-scripts'
- run: npm run apidoc
sanity:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Setup Shared Job Steps
uses: './.github/actions/shared-job-steps'
with:
node-version: ${{ matrix.node-version }}
node-env: 'test'
package-install-cmd: 'ci --ignore-scripts'
- run: npm run test:sanity
common:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Setup Shared Job Steps
uses: './.github/actions/shared-job-steps'
with:
node-version: ${{ matrix.node-version }}
node-env: 'test'
package-install-cmd: 'ci --ignore-scripts'
- run: npm run test:common
content:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Setup Shared Job Steps
uses: './.github/actions/shared-job-steps'
with:
node-version: ${{ matrix.node-version }}
node-env: 'test'
package-install-cmd: 'ci --ignore-scripts'
- run: npm run test:content
api-unit:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
mongodb-version: [4.2]
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Setup Shared Job Steps
uses: './.github/actions/shared-job-steps'
with:
node-version: ${{ matrix.node-version }}
node-env: 'test'
package-install-cmd: 'ci --ignore-scripts'
- name: Start MongoDB ${{ matrix.mongodb-version }} Replica Set
uses: supercharge/mongodb-github-action@1.3.0
with:
mongodb-version: ${{ matrix.mongodb-version }}
mongodb-replica-set: rs
- run: npm run test:api:unit
env:
REQUIRES_SERVER=true: true
api-v3-integration:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
mongodb-version: [4.2]
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Setup Shared Job Steps
uses: './.github/actions/shared-job-steps'
with:
node-version: ${{ matrix.node-version }}
node-env: 'test'
package-install-cmd: 'ci --ignore-scripts'
- name: Start MongoDB ${{ matrix.mongodb-version }} Replica Set
uses: supercharge/mongodb-github-action@1.3.0
with:
mongodb-version: ${{ matrix.mongodb-version }}
mongodb-replica-set: rs
- run: npm run test:api-v3:integration
env:
REQUIRES_SERVER=true: true
api-v4-integration:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
mongodb-version: [4.2]
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Setup Shared Job Steps
uses: './.github/actions/shared-job-steps'
with:
node-version: ${{ matrix.node-version }}
node-env: 'test'
package-install-cmd: 'ci --ignore-scripts'
- name: Start MongoDB ${{ matrix.mongodb-version }} Replica Set
uses: supercharge/mongodb-github-action@1.3.0
with:
mongodb-version: ${{ matrix.mongodb-version }}
mongodb-replica-set: rs
- run: npm run test:api-v4:integration
env:
REQUIRES_SERVER=true: true
client-unit:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Setup Shared Job Steps
uses: './.github/actions/shared-job-steps'
with:
node-version: ${{ matrix.node-version }}
node-env: 'test'
package-install-cmd: 'ci --ignore-scripts'
install-website-package: 'true'
website-package-install-cmd: 'ci --ignore-scripts'
- run: npm run test:unit
working-directory: ./website/client
production-build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Setup Shared Job Steps
uses: './.github/actions/shared-job-steps'
with:
node-version: ${{ matrix.node-version }}
node-env: 'production'