Compare commits

...

12 Commits

Author SHA1 Message Date
negue
f8fd4ae350 testing api-unit job 2023-07-23 00:40:47 +02:00
negue
21f69e4d7c use more inputs as cache key 2023-07-23 00:27:03 +02:00
negue
ee09b1b60e Merge remote-tracking branch 'origin/develop' into negue/ci-cache 2023-06-25 23:03:09 +02:00
negue
7f1d332441 changing workflow triggers of push to only develop and release 2023-06-25 22:39:13 +02:00
negue
b370a28c7a skip builds on more jobs 2023-05-30 23:52:59 +02:00
negue
493f90fe07 fix action.yml 2023-05-30 23:36:44 +02:00
negue
bbf537421a test ci lint to ignore building the server 2023-05-30 23:34:32 +02:00
negue
15cf900caa Merge remote-tracking branch 'origin/develop' into negue/ci-cache 2023-05-30 23:10:38 +02:00
negue
3c9771dd0e test cache hits 2023-05-30 23:09:20 +02:00
negue
1236b55664 fix composite steps 2023-05-09 00:46:06 +02:00
negue
ad7d4ac89e checkout in job level 2023-05-09 00:38:59 +02:00
negue
094c5b54d6 cache + first composite test 2023-05-09 00:37:21 +02:00
2 changed files with 136 additions and 93 deletions

View 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 }}

View File

@@ -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'