mirror of
https://github.com/PostHog/posthog.git
synced 2024-12-01 04:12:23 +01:00
68351f437a
* WIP more speed improvements * pick right files * Fix yarn install * try
69 lines
2.0 KiB
YAML
69 lines
2.0 KiB
YAML
name: Frontend CI
|
|
|
|
on:
|
|
- pull_request
|
|
|
|
jobs:
|
|
frontend-code-quality:
|
|
name: Code quality checks
|
|
runs-on: ubuntu-20.04
|
|
steps:
|
|
- uses: actions/checkout@v1
|
|
|
|
- name: Set up Node 14
|
|
uses: actions/setup-node@v1
|
|
with:
|
|
node-version: 14
|
|
|
|
- uses: actions/cache@v2
|
|
id: node-modules-cache
|
|
with:
|
|
path: |
|
|
node_modules
|
|
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-node-modules
|
|
|
|
- name: Install package.json dependencies with Yarn
|
|
if: steps.node-modules-cache.outputs.cache-hit != 'true'
|
|
run: yarn install --frozen-lockfile
|
|
|
|
- name: Check formatting with prettier
|
|
run: yarn prettier:check
|
|
|
|
- name: Lint with ESLint
|
|
run: yarn eslint
|
|
|
|
- name: Run typescript with strict
|
|
run: |
|
|
./bin/check-typescript-strict
|
|
|
|
jest:
|
|
name: Jest tests
|
|
runs-on: ubuntu-20.04
|
|
if: ${{ github.actor != 'posthog-contributions-bot[bot]' }}
|
|
|
|
steps:
|
|
- uses: actions/checkout@v1
|
|
|
|
- name: Set up Node 14
|
|
uses: actions/setup-node@v1
|
|
with:
|
|
node-version: 14
|
|
|
|
- uses: actions/cache@v2
|
|
id: node-modules-cache
|
|
with:
|
|
path: |
|
|
node_modules
|
|
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-node-modules
|
|
|
|
- name: Install package.json dependencies with Yarn
|
|
if: steps.node-modules-cache.outputs.cache-hit != 'true'
|
|
run: yarn install --frozen-lockfile
|
|
|
|
- name: Test with Jest
|
|
run: yarn test
|