[Monorepo] separate UI to its own package + create shell of API package #279
Workflow file for this run
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
# Autochecks the repo, using formatting and linting commands we run on precommit JUUUUST to be sure | |
name: Autochecks | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} | |
TURBO_TEAM: ${{ vars.TURBO_TEAM }} | |
jobs: | |
autocheck: | |
timeout-minutes: 5 | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
# Each of these are commands we should run and check output | |
command: ['lint', 'lint:types', 'format'] | |
outputs: | |
lint: ${{ steps.changes.outputs.lint }} | |
linttypes: ${{ steps.changes.outputs.linttypes }} | |
format: ${{ steps.changes.outputs.format }} | |
name: ${{ matrix.command }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v2 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version-file: .node-version | |
cache: 'pnpm' | |
- run: pnpm install | |
- name: ${{ matrix.command }} | |
run: NODE_OPTIONS=--max_old_space_size=8192 pnpm turbo ${{ matrix.command }} | |
- name: Output changed files | |
id: changes | |
# Removes both leading/trailing whitespace after getting diffed files and removing package.json/pnpm.lock | |
run: | | |
CHANGED="$(git diff --name-only --diff-filter=ACMRT | xargs | sed 's/package.json//g;s/pnpm.lock//g;s/^[ \t]*//g;s/[ \t]*$//g')" | |
COMMAND_NAME="${{ matrix.command }}" | |
OUTPUTNAME="${COMMAND_NAME//:/}" | |
echo "Changed files were: $CHANGED" | |
echo "$OUTPUTNAME=$CHANGED" >> $GITHUB_OUTPUT | |
# If anything is output, fails this job! | |
fail-on-diff: | |
timeout-minutes: 5 | |
runs-on: ubuntu-latest | |
needs: autocheck | |
if: ${{ needs.autocheck.outputs.lint || needs.autocheck.outputs.linttypes || needs.autocheck.outputs.format }} | |
steps: | |
- name: Exiting because of changed files | |
run: | | |
echo "Changed from lint: ${{needs.autocheck.outputs.lint || 'none'}}" | |
echo "Type check changed files: ${{needs.autocheck.outputs.linttypes || 'none'}}" | |
echo "Files formatted: ${{needs.autocheck.outputs.format || 'none'}}" | |
exit 1 |