Skip to content

Commit

Permalink
visualization: Add CI
Browse files Browse the repository at this point in the history
  • Loading branch information
eigendude committed Mar 8, 2024
1 parent f23b74a commit 6756183
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Prettier Code Formatter

# Controls when the action will run. Triggers the workflow on push or pull
# request events
on: [push, pull_request]

jobs:
prettier:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
node_version: 20

steps:
- name: Check out code
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '${{ matrix.node_version }}'

- name: Cache pnpm modules
id: cache-pnpm-modules
uses: actions/cache@v4
with:
path: oasis_visualization/node_modules
key: ${{ runner.os }}-${{ matrix.node_version }}-pnpm-${{ hashFiles('oasis_visualization/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-${{ matrix.node_version }}-pnpm-
- name: Install pnpm
run: npm install -g pnpm

- name: Install dependencies
if: steps.cache-pnpm-modules.outputs.cache-hit != 'true'
run: pnpm install
working-directory: oasis_visualization

- name: Run linter
run: pnpm run lint
working-directory: oasis_visualization
1 change: 1 addition & 0 deletions oasis_visualization/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/node_modules
2 changes: 2 additions & 0 deletions oasis_visualization/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/node_modules
/pnpm-lock.yaml
3 changes: 3 additions & 0 deletions oasis_visualization/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"tabWidth": 2
}
10 changes: 10 additions & 0 deletions oasis_visualization/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "oasis-visualization",
"scripts": {
"format": "prettier --write .",
"lint": "prettier --check ."
},
"devDependencies": {
"prettier": "^3.2.5"
}
}
18 changes: 18 additions & 0 deletions oasis_visualization/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6756183

Please sign in to comment.