Skip to content

Commit

Permalink
Merge pull request #377 from yeatmanlab/ci/format
Browse files Browse the repository at this point in the history
Add prettier formatting GitHub action
  • Loading branch information
richford authored Feb 20, 2024
2 parents bf3b176 + 9977e89 commit 770406e
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/deploy-firebase-test-cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ concurrency:

jobs:
build-and-preview:
name: Deploy preview
if: '${{ github.event.pull_request.head.repo.full_name == github.repository }}'
runs-on: ubuntu-latest
steps:
Expand All @@ -30,6 +31,7 @@ jobs:
deployUrl: ${{ fromJson(steps.firebase-deploy.outputs.urls)[0] }}

cypress-run:
name: Run Cypress Tests
needs: [build-and-preview]
runs-on: ubuntu-latest
timeout-minutes: 90
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/deploy-firestore-rules-indexes-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ name: Deploy Firestore Rules and Indexes (Development)

jobs:
deploy-admin-rules:
name: Admin Rules
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
Expand All @@ -19,6 +20,7 @@ jobs:
PROJECT_ID: gse-roar-admin-dev
PROJECT_PATH: ./firebase/admin
deploy-assessment-rules:
name: Assessment Rules
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
Expand All @@ -32,6 +34,7 @@ jobs:
PROJECT_ID: gse-roar-assessment-dev
PROJECT_PATH: ./firebase/assessment
deploy-admin-indexes:
name: Admin Indexes
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
Expand All @@ -45,6 +48,7 @@ jobs:
PROJECT_ID: gse-roar-admin-dev
PROJECT_PATH: ./firebase/admin
deploy-assessment-indexes:
name: Assessment Indexes
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ name: Deploy Firestore Rules and Indexes (Production)

jobs:
deploy-admin-rules:
name: Admin Rules
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
Expand All @@ -21,6 +22,7 @@ jobs:
PROJECT_ID: gse-roar-admin
PROJECT_PATH: ./firebase/admin
deploy-assessment-rules:
name: Assessment Rules
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
Expand All @@ -34,6 +36,7 @@ jobs:
PROJECT_ID: gse-roar-assessment
PROJECT_PATH: ./firebase/assessment
deploy-admin-indexes:
name: Admin Indexes
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
Expand All @@ -47,6 +50,7 @@ jobs:
PROJECT_ID: gse-roar-admin
PROJECT_PATH: ./firebase/admin
deploy-assessment-indexes:
name: Assessment Indexes
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/firebase-hosting-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ name: Deploy to Firebase Hosting (production)
- 'v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+'
jobs:
build_and_deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Format

on:
# Trigger the workflow on push or pull request,
# but only for the main branch
push:
branches:
- main
pull_request:
types: [opened, reopened, synchronize]
branches:
- main

jobs:
build-and-lint:
name: Prettier
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- run: npm ci
- run: npm run check-format
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"emulate:stop": "ps -e | grep 'firebase emulators:start' | grep -v 'grep' | grep -v 'rg' | sed -e 's/^[ \t]*//' | tr -s ' ' | cut -d ' ' -f 1 | xargs kill -s INT",
"cypress:open": "cypress open",
"format": "prettier . --write",
"check-format": "prettier . --check",
"lint": "eslint --ext .js,.vue --ignore-path .gitignore --fix src",
"postversion": "GIT_REMOTE=$(git remote -v | grep \"yeatmanlab/roar-dashboard.git \\(push\\)\" | cut -f 1) && git push $GIT_REMOTE && git push $GIT_REMOTE --tags",
"prepare": "husky install",
Expand Down

0 comments on commit 770406e

Please sign in to comment.