mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-10-26 10:42:52 +01:00
Compare commits
12 Commits
v5.20.0
...
negue/ci-c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f8fd4ae350 | ||
|
|
21f69e4d7c | ||
|
|
ee09b1b60e | ||
|
|
7f1d332441 | ||
|
|
b370a28c7a | ||
|
|
493f90fe07 | ||
|
|
bbf537421a | ||
|
|
15cf900caa | ||
|
|
3c9771dd0e | ||
|
|
1236b55664 | ||
|
|
ad7d4ac89e | ||
|
|
094c5b54d6 |
61
.github/actions/shared-job-steps/action.yml
vendored
Normal file
61
.github/actions/shared-job-steps/action.yml
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
name: job setup
|
||||
description: 'Sets the shared steps for each job'
|
||||
|
||||
inputs:
|
||||
node-version:
|
||||
description: 'The Node version to be setup'
|
||||
required: true
|
||||
node-env:
|
||||
description: 'Node-Env for CI'
|
||||
required: true
|
||||
package-install-cmd:
|
||||
description: 'CI or install or custom to skip post install and unneeded builds'
|
||||
required: false
|
||||
default: 'ci'
|
||||
install-website-package:
|
||||
description: 'if package-install-cmd skipped post install, you can trigger an installation of website'
|
||||
required: false
|
||||
default: 'false'
|
||||
|
||||
website-package-install-cmd:
|
||||
description: 'CI or install or custom to skip post install and unneeded builds'
|
||||
required: false
|
||||
default: 'ci'
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Use Node.js ${{ inputs.node-version }}
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ inputs.node-version }}
|
||||
- name: Cache multiple paths
|
||||
id: cache-package
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
**/node_modules
|
||||
key: ${{ runner.os }}-${{ inputs.node-version }}-${{ inputs.node-env }}-${{ inputs.install-website-package }}-${{ hashFiles('**/package.json') }}
|
||||
|
||||
- name: Create dummy config.json
|
||||
shell: bash
|
||||
run: cp config.json.example config.json
|
||||
|
||||
- name: npm install
|
||||
if: steps.cache-package.outputs.cache-hit != 'true'
|
||||
shell: bash
|
||||
run: |
|
||||
npm ${{ inputs.package-install-cmd }}
|
||||
env:
|
||||
CI: true
|
||||
NODE_ENV: ${{ inputs.node-env }}
|
||||
|
||||
- name: npm install website
|
||||
if: ${{ steps.cache-package.outputs.cache-hit != 'true' && inputs.install-website-package != 'false' }}
|
||||
shell: bash
|
||||
working-directory: ./website/client
|
||||
run: |
|
||||
npm ${{ inputs.website-package-install-cmd }}
|
||||
env:
|
||||
CI: true
|
||||
NODE_ENV: ${{ inputs.node-env }}
|
||||
168
.github/workflows/test.yml
vendored
168
.github/workflows/test.yml
vendored
@@ -1,6 +1,13 @@
|
||||
name: Test
|
||||
|
||||
on: [push, pull_request]
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
push:
|
||||
branches:
|
||||
- 'develop'
|
||||
- 'release'
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
@@ -15,17 +22,16 @@ jobs:
|
||||
- uses: actions/checkout@v1
|
||||
with:
|
||||
fetch-depth: 1
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v1
|
||||
|
||||
- name: Setup Shared Job Steps
|
||||
uses: './.github/actions/shared-job-steps'
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
- run: cp config.json.example config.json
|
||||
- name: npm install
|
||||
run: |
|
||||
npm ci
|
||||
env:
|
||||
CI: true
|
||||
NODE_ENV: test
|
||||
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
|
||||
@@ -36,17 +42,14 @@ jobs:
|
||||
- uses: actions/checkout@v1
|
||||
with:
|
||||
fetch-depth: 1
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v1
|
||||
|
||||
- name: Setup Shared Job Steps
|
||||
uses: './.github/actions/shared-job-steps'
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
- run: cp config.json.example config.json
|
||||
- name: npm install
|
||||
run: |
|
||||
npm ci
|
||||
env:
|
||||
CI: true
|
||||
NODE_ENV: test
|
||||
node-env: 'test'
|
||||
package-install-cmd: 'ci --ignore-scripts'
|
||||
|
||||
- run: npm run apidoc
|
||||
sanity:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -57,19 +60,16 @@ jobs:
|
||||
- uses: actions/checkout@v1
|
||||
with:
|
||||
fetch-depth: 1
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v1
|
||||
|
||||
- name: Setup Shared Job Steps
|
||||
uses: './.github/actions/shared-job-steps'
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
- run: cp config.json.example config.json
|
||||
- name: npm install
|
||||
run: |
|
||||
npm ci
|
||||
env:
|
||||
CI: true
|
||||
NODE_ENV: test
|
||||
node-env: 'test'
|
||||
package-install-cmd: 'ci --ignore-scripts'
|
||||
|
||||
- run: npm run test:sanity
|
||||
|
||||
|
||||
common:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
@@ -79,17 +79,14 @@ jobs:
|
||||
- uses: actions/checkout@v1
|
||||
with:
|
||||
fetch-depth: 1
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v1
|
||||
|
||||
- name: Setup Shared Job Steps
|
||||
uses: './.github/actions/shared-job-steps'
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
- run: cp config.json.example config.json
|
||||
- name: npm install
|
||||
run: |
|
||||
npm ci
|
||||
env:
|
||||
CI: true
|
||||
NODE_ENV: test
|
||||
node-env: 'test'
|
||||
package-install-cmd: 'ci --ignore-scripts'
|
||||
|
||||
- run: npm run test:common
|
||||
content:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -100,19 +97,16 @@ jobs:
|
||||
- uses: actions/checkout@v1
|
||||
with:
|
||||
fetch-depth: 1
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v1
|
||||
|
||||
- name: Setup Shared Job Steps
|
||||
uses: './.github/actions/shared-job-steps'
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
- run: cp config.json.example config.json
|
||||
- name: npm install
|
||||
run: |
|
||||
npm ci
|
||||
env:
|
||||
CI: true
|
||||
NODE_ENV: test
|
||||
node-env: 'test'
|
||||
package-install-cmd: 'ci --ignore-scripts'
|
||||
|
||||
- run: npm run test:content
|
||||
|
||||
|
||||
api-unit:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
@@ -123,22 +117,20 @@ jobs:
|
||||
- uses: actions/checkout@v1
|
||||
with:
|
||||
fetch-depth: 1
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v1
|
||||
|
||||
- name: Setup Shared Job Steps
|
||||
uses: './.github/actions/shared-job-steps'
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
node-env: 'test'
|
||||
package-install-cmd: 'ci'
|
||||
|
||||
- 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: cp config.json.example config.json
|
||||
- name: npm install
|
||||
run: |
|
||||
npm ci
|
||||
env:
|
||||
CI: true
|
||||
NODE_ENV: test
|
||||
|
||||
- run: npm run test:api:unit
|
||||
env:
|
||||
REQUIRES_SERVER=true: true
|
||||
@@ -152,22 +144,20 @@ jobs:
|
||||
- uses: actions/checkout@v1
|
||||
with:
|
||||
fetch-depth: 1
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v1
|
||||
|
||||
- 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: cp config.json.example config.json
|
||||
- name: npm install
|
||||
run: |
|
||||
npm ci
|
||||
env:
|
||||
CI: true
|
||||
NODE_ENV: test
|
||||
|
||||
- run: npm run test:api-v3:integration
|
||||
env:
|
||||
REQUIRES_SERVER=true: true
|
||||
@@ -181,22 +171,20 @@ jobs:
|
||||
- uses: actions/checkout@v1
|
||||
with:
|
||||
fetch-depth: 1
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v1
|
||||
|
||||
- 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: cp config.json.example config.json
|
||||
- name: npm install
|
||||
run: |
|
||||
npm ci
|
||||
env:
|
||||
CI: true
|
||||
NODE_ENV: test
|
||||
|
||||
- run: npm run test:api-v4:integration
|
||||
env:
|
||||
REQUIRES_SERVER=true: true
|
||||
@@ -210,17 +198,16 @@ jobs:
|
||||
- uses: actions/checkout@v1
|
||||
with:
|
||||
fetch-depth: 1
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v1
|
||||
|
||||
- name: Setup Shared Job Steps
|
||||
uses: './.github/actions/shared-job-steps'
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
- run: cp config.json.example config.json
|
||||
- name: npm install
|
||||
run: |
|
||||
npm ci
|
||||
env:
|
||||
CI: true
|
||||
NODE_ENV: test
|
||||
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
|
||||
|
||||
@@ -233,14 +220,9 @@ jobs:
|
||||
- uses: actions/checkout@v1
|
||||
with:
|
||||
fetch-depth: 1
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v1
|
||||
|
||||
- name: Setup Shared Job Steps
|
||||
uses: './.github/actions/shared-job-steps'
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
- run: cp config.json.example config.json
|
||||
- name: npm install
|
||||
run: |
|
||||
npm install
|
||||
env:
|
||||
CI: true
|
||||
NODE_ENV: production
|
||||
node-env: 'production'
|
||||
|
||||
Reference in New Issue
Block a user