Skip to content

Commit

Permalink
Format and lint on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
axelboc committed Jul 18, 2023
1 parent a706c00 commit 01ef256
Showing 1 changed file with 66 additions and 0 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/format_and_lint_ui.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Format UI

on: [push, pull_request]

jobs:
format:
runs-on: ubuntu-latest

# Skip `pull_request` runs on local PRs for which `push` runs are already triggered
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository

steps:
- name: Checkout 🏷️
uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}

- name: Add conda to system path
run: |
# $CONDA is an environment variable pointing to the root of the miniconda directory
echo $CONDA/bin >> $GITHUB_PATH
- name: Install Conda dependencies
run: |
conda env update --file conda-environment.yml --name base
pip install -e .
- name: Install NPM dependencies
run: npm install --prefix ./ui

- name: Check formatting
run: npm run --prefix ./ui prettier

lint:
runs-on: ubuntu-latest

# Skip `pull_request` runs on local PRs for which `push` runs are already triggered
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository

steps:
- name: Checkout 🏷️
uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}

- name: Add conda to system path
run: |
# $CONDA is an environment variable pointing to the root of the miniconda directory
echo $CONDA/bin >> $GITHUB_PATH
- name: Install Conda dependencies
run: |
conda env update --file conda-environment.yml --name base
pip install -e .
- name: Install NPM dependencies
run: npm install --prefix ./ui

- name: Lint
run: npm run --prefix ./ui eslint

0 comments on commit 01ef256

Please sign in to comment.