2020-10-25 04:56:04 +00:00
|
|
|
# License: LGPL-3.0-or-later
|
|
|
|
name: Javascript build and test
|
2020-10-30 18:24:46 +00:00
|
|
|
env:
|
2021-03-01 01:01:11 +00:00
|
|
|
ruby: '2.7.2'
|
2020-10-25 04:56:04 +00:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
paths-ignore:
|
|
|
|
- "**.md"
|
|
|
|
pull_request:
|
|
|
|
paths-ignore:
|
|
|
|
- "**.md"
|
|
|
|
jobs:
|
|
|
|
lint:
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2021-03-15 19:29:22 +00:00
|
|
|
os: [ubuntu-20.04]
|
2020-10-25 04:56:04 +00:00
|
|
|
node: [14.6.0]
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2020-11-24 22:20:51 +00:00
|
|
|
- name: Setup PostgreSQL with PostgreSQL extensions and unprivileged user
|
|
|
|
uses: Daniel-Marynicz/postgresql-action@0.1.0
|
|
|
|
with:
|
|
|
|
postgres_image_tag: 11-alpine
|
|
|
|
postgres_user: houdini_user
|
|
|
|
postgres_password: password
|
2020-11-18 17:12:10 +00:00
|
|
|
- uses: actions/setup-node@v1.4.4
|
2020-10-25 04:56:04 +00:00
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node }}
|
2020-10-25 18:21:58 +00:00
|
|
|
- name: Get yarn cache directory path
|
|
|
|
id: yarn-cache-dir-path
|
|
|
|
run: echo "::set-output name=dir::$(yarn cache dir)"
|
|
|
|
|
|
|
|
- uses: actions/cache@v2
|
2020-10-25 04:56:04 +00:00
|
|
|
with:
|
2020-10-25 18:21:58 +00:00
|
|
|
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
2020-10-25 19:04:10 +00:00
|
|
|
key: ${{ matrix.os }}-yarn-${{ matrix.node }}-${{ hashFiles('**/yarn.lock') }}
|
2020-10-25 04:56:04 +00:00
|
|
|
restore-keys: |
|
2020-10-25 19:04:10 +00:00
|
|
|
${{ matrix.os }}-yarn-${{ matrix.node }}-
|
|
|
|
${{ matrix.os }}-yarn-
|
2020-10-25 04:56:04 +00:00
|
|
|
- run: yarn install --frozen-lockfile
|
2020-11-18 17:13:00 +00:00
|
|
|
- uses: ruby/setup-ruby@v1
|
2020-10-30 18:24:46 +00:00
|
|
|
with:
|
|
|
|
ruby-version: ${{ env.ruby }}
|
|
|
|
- uses: actions/cache@v2
|
|
|
|
name: Use Gem cache
|
|
|
|
with:
|
|
|
|
path: vendor/bundle
|
|
|
|
key: bundle-use-ruby-${{ matrix.os }}-${{ env.ruby }}-${{ hashFiles('**/Gemfile.lock') }}
|
|
|
|
restore-keys: |
|
|
|
|
bundle-use-ruby-${{ matrix.os }}-${{ env.ruby }}-
|
|
|
|
- run: |
|
|
|
|
bundle config deployment true
|
|
|
|
bundle config path vendor/bundle
|
|
|
|
bundle install --jobs 4
|
2020-11-24 22:20:51 +00:00
|
|
|
- run: bin/setup ci
|
2020-10-25 04:56:04 +00:00
|
|
|
- name: run eslint
|
|
|
|
run: yarn eslint
|
|
|
|
jest:
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2021-03-15 19:29:22 +00:00
|
|
|
os: [ubuntu-20.04]
|
2020-10-25 04:56:04 +00:00
|
|
|
node: [14.6.0]
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2020-11-24 22:20:51 +00:00
|
|
|
- name: Setup PostgreSQL with PostgreSQL extensions and unprivileged user
|
|
|
|
uses: Daniel-Marynicz/postgresql-action@0.1.0
|
|
|
|
with:
|
|
|
|
postgres_image_tag: 11-alpine
|
|
|
|
postgres_user: houdini_user
|
|
|
|
postgres_password: password
|
2020-11-18 17:12:10 +00:00
|
|
|
- uses: actions/setup-node@v1.4.4
|
2020-10-25 04:56:04 +00:00
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node }}
|
2020-10-25 18:21:58 +00:00
|
|
|
- name: Get yarn cache directory path
|
|
|
|
id: yarn-cache-dir-path
|
|
|
|
run: echo "::set-output name=dir::$(yarn cache dir)"
|
|
|
|
|
|
|
|
- uses: actions/cache@v2
|
2020-10-25 04:56:04 +00:00
|
|
|
with:
|
2020-10-25 18:21:58 +00:00
|
|
|
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
2020-10-25 19:04:10 +00:00
|
|
|
key: ${{ matrix.os }}-yarn-${{ matrix.node }}-${{ hashFiles('**/yarn.lock') }}
|
2020-10-25 04:56:04 +00:00
|
|
|
restore-keys: |
|
2020-10-25 19:04:10 +00:00
|
|
|
${{ matrix.os }}-yarn-${{ matrix.node }}-
|
|
|
|
${{ matrix.os }}-yarn-
|
2020-10-25 04:56:04 +00:00
|
|
|
- run: yarn install --frozen-lockfile
|
2020-11-18 17:13:00 +00:00
|
|
|
- uses: ruby/setup-ruby@v1
|
2020-10-30 18:24:46 +00:00
|
|
|
with:
|
|
|
|
ruby-version: ${{ env.ruby }}
|
|
|
|
- uses: actions/cache@v2
|
|
|
|
name: Use Gem cache
|
|
|
|
with:
|
|
|
|
path: vendor/bundle
|
|
|
|
key: bundle-use-ruby-${{ matrix.os }}-${{ env.ruby }}-${{ hashFiles('**/Gemfile.lock') }}
|
|
|
|
restore-keys: |
|
|
|
|
bundle-use-ruby-${{ matrix.os }}-${{ env.ruby }}-
|
|
|
|
- run: |
|
|
|
|
bundle config deployment true
|
|
|
|
bundle config path vendor/bundle
|
|
|
|
bundle install --jobs 4
|
2020-11-24 22:20:51 +00:00
|
|
|
- run: bin/setup ci
|
2020-10-25 04:56:04 +00:00
|
|
|
- name: run jest
|
|
|
|
run: yarn jest
|
|
|
|
webpack:
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2021-03-15 19:29:22 +00:00
|
|
|
os: [ubuntu-20.04]
|
2020-10-25 04:56:04 +00:00
|
|
|
node: [14.6.0]
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Setup PostgreSQL with PostgreSQL extensions and unprivileged user
|
|
|
|
uses: Daniel-Marynicz/postgresql-action@0.1.0
|
|
|
|
with:
|
|
|
|
postgres_image_tag: 11-alpine
|
|
|
|
postgres_user: houdini_user
|
|
|
|
postgres_password: password
|
2020-11-18 17:12:10 +00:00
|
|
|
- uses: actions/setup-node@v1.4.4
|
2020-10-25 04:56:04 +00:00
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node }}
|
2020-10-25 18:21:58 +00:00
|
|
|
- name: Get yarn cache directory path
|
|
|
|
id: yarn-cache-dir-path
|
|
|
|
run: echo "::set-output name=dir::$(yarn cache dir)"
|
|
|
|
|
|
|
|
- uses: actions/cache@v2
|
2020-10-25 04:56:04 +00:00
|
|
|
with:
|
2020-10-25 18:21:58 +00:00
|
|
|
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
2020-10-25 19:04:10 +00:00
|
|
|
key: ${{ matrix.os }}-yarn-${{ matrix.node }}-${{ hashFiles('**/yarn.lock') }}
|
2020-10-25 04:56:04 +00:00
|
|
|
restore-keys: |
|
2020-10-25 19:04:10 +00:00
|
|
|
${{ matrix.os }}-yarn-${{ matrix.node }}-
|
|
|
|
${{ matrix.os }}-yarn-
|
2020-10-25 04:56:04 +00:00
|
|
|
- run: yarn install --frozen-lockfile
|
2020-11-18 17:13:00 +00:00
|
|
|
- uses: ruby/setup-ruby@v1
|
2020-10-25 04:56:04 +00:00
|
|
|
with:
|
2020-10-30 18:24:46 +00:00
|
|
|
ruby-version: ${{ env.ruby }}
|
2020-10-25 19:04:10 +00:00
|
|
|
- uses: actions/cache@v2
|
2020-10-25 04:56:04 +00:00
|
|
|
name: Use Gem cache
|
|
|
|
with:
|
|
|
|
path: vendor/bundle
|
2020-10-30 18:24:46 +00:00
|
|
|
key: bundle-use-ruby-${{ matrix.os }}-${{ env.ruby }}-${{ hashFiles('**/Gemfile.lock') }}
|
2020-10-25 04:56:04 +00:00
|
|
|
restore-keys: |
|
2020-10-30 18:24:46 +00:00
|
|
|
bundle-use-ruby-${{ matrix.os }}-${{ env.ruby }}-
|
2020-10-25 04:56:04 +00:00
|
|
|
- run: |
|
|
|
|
bundle config deployment true
|
|
|
|
bundle config path vendor/bundle
|
|
|
|
bundle install --jobs 4
|
|
|
|
- name: run setup
|
|
|
|
run: bin/setup ci
|
|
|
|
- name: Webpack compile everything
|
2020-11-24 22:20:51 +00:00
|
|
|
run: yarn webpack
|
2020-10-25 04:56:04 +00:00
|
|
|
- name: Verify storybook compiles
|
|
|
|
run: yarn build-storybook
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|