Coderefs - Bump to latest (#2185) #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: main | |
paths: | |
- "packages/**" | |
- "yarn.lock" | |
- ".eslintrc" | |
- ".eslintignore" | |
- ".prettierignore" | |
pull_request: | |
paths: | |
- "packages/**" | |
- "yarn.lock" | |
- ".eslintrc" | |
- ".eslintignore" | |
- ".prettierignore" | |
jobs: | |
# Linting, type-checking, and tests | |
ci: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
cache: 'yarn' | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.11 | |
cache: 'pip' | |
- name: Cache eslint | |
uses: actions/cache@v2 | |
with: | |
path: ${{ github.workspace }}/.eslintcache | |
key: ${{ runner.os }}-eslint-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/*.ts', '**/*.tsx') }} | |
restore-keys: | | |
${{ runner.os }}-eslint- | |
- name: Install dependencies | |
run: | | |
# Main app | |
yarn install | |
# Stats engine | |
pip install pipx | |
pipx install poetry | |
env: | |
CI: true | |
- name: Build dependencies | |
run: | | |
# Build required dependencies (sdks/shared package) | |
# This is required for linting/type checks to work | |
yarn setup | |
env: | |
CI: true | |
- name: Lint | |
run: | | |
yarn lint:ci | |
yarn workspace stats lint:ci | |
env: | |
CI: true | |
- name: Check api types | |
run: | | |
yarn generate-api-types | |
[[ -n $(git status --porcelain) ]] && echo "You need to run yarn generate-api-types" && exit 1 || true | |
- name: Type-check | |
run: | | |
yarn type-check | |
env: | |
CI: true | |
- name: Test | |
run: | | |
yarn test | |
env: | |
CI: true |