Skip to content

Commit

Permalink
ci: add frontend action
Browse files Browse the repository at this point in the history
  • Loading branch information
k1eu committed Aug 9, 2024
1 parent b694be5 commit 22a30b6
Show file tree
Hide file tree
Showing 2 changed files with 119 additions and 0 deletions.
92 changes: 92 additions & 0 deletions .github/workflows/pr-frontend-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Frontend Pull Request Check

on:
pull_request:
branches:
- main
paths:
- apps/web/**
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./apps/web/
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4

- uses: actions/setup-node@v4
with:
node-version: 20.15.0
cache: pnpm

- name: Install dependencies
run: pnpm install

- name: Run ESLint & Compile Typescript
run: pnpm lint-tsc

build:
name: Build app
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./apps/web/
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 20.15.0
cache: pnpm

- run: pnpm install
- name: Build the app
run: pnpm run build

test:
name: Vitest tests
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./apps/web/
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4

- uses: actions/setup-node@v4
with:
node-version: 20.15.0
cache: pnpm

- name: Install dependencies
run: pnpm install

- name: Run Vite tests
run: pnpm test

playwright:
needs: build
name: "Playwright Tests"
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.46.0-jammy
defaults:
run:
working-directory: ./apps/web/
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 8
- uses: actions/setup-node@v4
with:
node-version: 20.15.0
- name: Install dependencies
run: pnpm install
- name: Run your tests
run: pnpm playwright test
env:
HOME: /root
27 changes: 27 additions & 0 deletions .github/workflows/pr-open-notification.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
## Add SLACK_WEBHOOK for a channel notification

# name: Pull Request Open Notification

# on:
# pull_request:
# types: [ready_for_review, reopened]

# jobs:
# slack_notification_pr:
# runs-on: ubuntu-latest
# name: Slack Notification
# if: ${{ always() }}
# steps:
# - uses: actions/checkout@v3
# - name: Slack Notification
# uses: rtCamp/action-slack-notify@master
# env:
# SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
# SLACK_COLOR: '#005994'
# SLACK_USERNAME: 'Github Project Notifier'
# SLACK_ICON_EMOJI: ':node:'
# SLACK_LINK_NAMES: true
# SLACK_TITLE: 'New Pull Request! :nerd_face:'
# MSG_MINIMAL: true
# SLACK_MESSAGE: ' ${{ github.event.pull_request.title }} - ${{ github.event.pull_request.html_url }}'
# SLACK_FOOTER: 'Please review in your :coffee: time'

0 comments on commit 22a30b6

Please sign in to comment.