Skip to content

Commit

Permalink
chore: Set up CI workflow, PR title checker, and added pull request t…
Browse files Browse the repository at this point in the history
…emplate
  • Loading branch information
jw-r committed Apr 11, 2024
1 parent cf44a58 commit ad1acd7
Show file tree
Hide file tree
Showing 4 changed files with 104 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/actions/prepare/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: 'Prepare: Install'
description: 'Prepares the repo by installing dependencies'

runs:
using: 'composite'
steps:
- name: echo github.ref
shell: bash
run: echo ${{ github.ref }}

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
shell: bash
run: npm ci
5 changes: 5 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## 개요

### 세부 내용

### 관련 링크
46 changes: 46 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- '**'

concurrency:
group: '${{ github.workflow }} - ${{ github.head_ref || github.ref }}'
cancel-in-progress: true

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/prepare
- name: Build
run: npm run build
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/prepare
- name: Lint
run: npm run check:lint
spell:
name: Spell
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/prepare
- name: Spell
run: npm run check:spell
format:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/prepare
- name: Install
run: npm run check:format
34 changes: 34 additions & 0 deletions .github/workflows/pr-title-checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Conventional PR Title Checker

on:
pull_request:
types:
- opened
- edited
- synchronize

permissions:
pull-requests: read

jobs:
main:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
types: |
docs
feat
fix
test
chore
ci
refactor
requireScope: false
subjectPattern: ^[a-z].+[^\.]$
subjectPatternError: |
The "subject" must start with a lower-case letter and must not
end with a full-stop.

0 comments on commit ad1acd7

Please sign in to comment.