2021-02-02 14:07:02 +01:00
|
|
|
name: 'CI'
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
2022-06-08 14:31:36 +02:00
|
|
|
- v3
|
2021-02-02 14:07:02 +01:00
|
|
|
tags:
|
|
|
|
- '**'
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- '**'
|
|
|
|
|
|
|
|
jobs:
|
2022-05-12 12:35:07 +02:00
|
|
|
build:
|
2021-02-02 14:07:02 +01:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
2022-12-01 10:09:40 +01:00
|
|
|
node: ['18']
|
2021-02-02 14:07:02 +01:00
|
|
|
|
|
|
|
steps:
|
2022-09-22 15:22:31 +02:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-node@v3
|
2021-02-02 14:07:02 +01:00
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node }}
|
|
|
|
|
|
|
|
- name: Cache node_modules
|
2022-09-22 15:22:31 +02:00
|
|
|
uses: actions/cache@v3
|
2021-02-02 14:07:02 +01:00
|
|
|
env:
|
|
|
|
cache-name: cache-node-modules
|
|
|
|
with:
|
|
|
|
path: ~/.npm
|
|
|
|
key: ${{ runner.os }}-${{ matrix.node }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
|
|
|
|
restore-keys: ${{ runner.os }}-${{ matrix.node }}-build-${{ env.cache-name }}-
|
|
|
|
|
2022-09-22 15:22:31 +02:00
|
|
|
- run: npm ci
|
2021-02-02 14:07:02 +01:00
|
|
|
- run: npm run build
|
2022-05-12 12:35:07 +02:00
|
|
|
|
|
|
|
test:
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
2022-12-01 10:09:40 +01:00
|
|
|
node: ['18']
|
2022-05-12 12:35:07 +02:00
|
|
|
|
|
|
|
steps:
|
2022-09-22 15:22:31 +02:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-node@v3
|
2022-05-12 12:35:07 +02:00
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node }}
|
|
|
|
|
|
|
|
- name: Cache node_modules
|
2022-09-22 15:22:31 +02:00
|
|
|
uses: actions/cache@v3
|
2022-05-12 12:35:07 +02:00
|
|
|
env:
|
|
|
|
cache-name: cache-node-modules
|
|
|
|
with:
|
|
|
|
path: ~/.npm
|
|
|
|
key: ${{ runner.os }}-${{ matrix.node }}-test-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
|
|
|
|
restore-keys: ${{ runner.os }}-${{ matrix.node }}-test-${{ env.cache-name }}-
|
|
|
|
|
2022-09-22 15:22:31 +02:00
|
|
|
- run: npm ci
|
2022-05-09 15:33:44 +02:00
|
|
|
- run: npm test
|
2021-02-02 14:07:02 +01:00
|
|
|
|
2022-05-12 12:35:07 +02:00
|
|
|
- name: Upload coverage artifact
|
2022-09-22 15:22:31 +02:00
|
|
|
uses: actions/upload-artifact@v3
|
2022-05-09 15:33:44 +02:00
|
|
|
with:
|
2022-05-12 12:35:07 +02:00
|
|
|
name: coverage-${{ runner.os }}
|
2022-05-09 15:33:44 +02:00
|
|
|
path: coverage/
|
|
|
|
|
2022-05-16 15:38:48 +02:00
|
|
|
coverage:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: [test]
|
|
|
|
if: ${{ success() && github.actor != 'dependabot[bot]' }}
|
|
|
|
|
|
|
|
steps:
|
2022-09-22 15:22:31 +02:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-node@v3
|
2022-05-16 15:38:48 +02:00
|
|
|
with:
|
2022-12-01 10:09:40 +01:00
|
|
|
node-version: '18'
|
2022-05-16 15:38:48 +02:00
|
|
|
- name: Cache node_modules
|
2022-09-22 15:22:31 +02:00
|
|
|
uses: actions/cache@v3
|
2022-05-16 15:38:48 +02:00
|
|
|
env:
|
|
|
|
cache-name: cache-node-modules
|
|
|
|
with:
|
|
|
|
path: ~/.npm
|
|
|
|
key: ${{ runner.os }}-coverage-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
|
|
|
|
restore-keys: ${{ runner.os }}-coverage-${{ env.cache-name }}-
|
|
|
|
|
2022-09-22 15:22:31 +02:00
|
|
|
- uses: actions/download-artifact@v3
|
2022-05-16 15:38:48 +02:00
|
|
|
with:
|
|
|
|
name: coverage-${{ runner.os }}
|
|
|
|
|
2022-09-22 15:22:31 +02:00
|
|
|
- run: npm ci
|
2022-05-16 15:38:48 +02:00
|
|
|
- run: npm run codegen:apollo
|
|
|
|
|
|
|
|
- uses: paambaati/codeclimate-action@v3.0.0
|
|
|
|
env:
|
|
|
|
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
|
2022-05-12 12:35:07 +02:00
|
|
|
|
|
|
|
storybook:
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
2022-12-01 10:09:40 +01:00
|
|
|
node: ['18']
|
2022-05-12 12:35:07 +02:00
|
|
|
|
2022-05-09 15:33:44 +02:00
|
|
|
steps:
|
2022-09-22 15:22:31 +02:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-node@v3
|
2022-05-09 15:33:44 +02:00
|
|
|
with:
|
2022-05-12 12:35:07 +02:00
|
|
|
node-version: ${{ matrix.node }}
|
2022-05-09 15:33:44 +02:00
|
|
|
|
2022-05-12 12:35:07 +02:00
|
|
|
- name: Cache node_modules
|
2022-09-22 15:22:31 +02:00
|
|
|
uses: actions/cache@v3
|
2022-05-09 15:33:44 +02:00
|
|
|
env:
|
2022-05-12 12:35:07 +02:00
|
|
|
cache-name: cache-node-modules
|
|
|
|
with:
|
|
|
|
path: ~/.npm
|
|
|
|
key: ${{ runner.os }}-${{ matrix.node }}-storybook-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
|
|
|
|
restore-keys: ${{ runner.os }}-${{ matrix.node }}-storybook-${{ env.cache-name }}-
|
|
|
|
|
2022-09-22 15:22:31 +02:00
|
|
|
- run: npm ci
|
2022-05-23 13:29:37 +02:00
|
|
|
- run: npm run pregenerate
|
2022-05-12 12:35:07 +02:00
|
|
|
- run: npm run storybook:build
|