Bot - Fix Formatting #200
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
name: 💯 Validate | |
on: | |
push: | |
branches: | |
- '**' # all branches | |
- '!main' | |
jobs: | |
typecheck: | |
name: 🎯 Typecheck | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
- run: npm i | |
- run: npm run typecheck | |
format: | |
name: 🔨 Format | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.BOT_GH_TOKEN }} | |
ref: ${{ github.head_ref }} | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
- run: npm i | |
- run: npm run format | |
- name: Commit and Push | |
uses: stefanzweifel/[email protected] | |
id: auto_commit_action | |
with: | |
commit_user_name: homie_bot | |
commit_user_email: [email protected] | |
commit_author: homie bot <[email protected]> | |
commit_message: Bot - Fix Formatting | |
- name: Success | |
if: steps.auto_commit_action.outputs.changes_detected == 'false' | |
run: echo "Format check... PASS!" | |
- name: Fail | |
if: steps.auto_commit_action.outputs.changes_detected == 'true' | |
run: echo "Fixed formatting, and pushed changes" && exit 1 | |
test: | |
name: 🧪 Test | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:16.2 | |
ports: | |
- 5432:5432 | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_DB: homie | |
POSTGRES_HOST_AUTH_METHOD: trust # No PW required | |
options: |- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
- run: npm i | |
- run: npm run test |