-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
66 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: Format and lint | ||
|
||
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 |