Skip to content

Commit 561fc54

Browse files
authored
Merge pull request #99 from sipe-team/develop
ci: ci lint check 파이프라인 적용
2 parents 8b228c4 + 7ae429d commit 561fc54

File tree

4 files changed

+320
-230
lines changed

4 files changed

+320
-230
lines changed

.github/workflows/ci.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches: [develop]
6+
push:
7+
branches: [develop]
8+
9+
env:
10+
CACHED_DEPENDENCY_PATHS: |
11+
.yarn/cache
12+
.yarn/unplugged
13+
.yarn/build-state.yml
14+
.yarn/install-state.gz
15+
.pnp.*
16+
CACHED_BUILD_PATHS: ${{ github.workspace }}/.next
17+
DEFAULT_NODE_VERSION: "v20.12.2"
18+
DEFAULT_YARN_VERSION: "4.5.0"
19+
20+
jobs:
21+
job_install_dependencies:
22+
name: Install Dependencies
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Check out current commit (${{ github.sha }})
26+
uses: actions/checkout@v4
27+
- name: Set up Node
28+
uses: actions/setup-node@v4
29+
with:
30+
node-version: ${{ env.DEFAULT_NODE_VERSION }}
31+
32+
- name: Set up Yarn
33+
run: |
34+
corepack enable
35+
yarn set version ${{ env.DEFAULT_YARN_VERSION }}
36+
yarn --version
37+
38+
- name: Get yarn cache directory path
39+
id: yarn-cache-dir-path
40+
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
41+
42+
- name: Compute dependency cache key
43+
id: compute_lockfile_hash
44+
run: echo "hash=${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}" >> $GITHUB_OUTPUT
45+
46+
- name: Check dependency cache
47+
uses: actions/cache@v4
48+
id: cache_dependencies
49+
with:
50+
path: |
51+
${{ steps.yarn-cache-dir-path.outputs.dir }}
52+
${{ env.CACHED_DEPENDENCY_PATHS }}
53+
key: ${{ steps.compute_lockfile_hash.outputs.hash }}
54+
restore-keys: |
55+
${{ runner.os }}-yarn-
56+
57+
- name: Install dependencies
58+
if: steps.cache_dependencies.outputs.cache-hit != 'true'
59+
run: yarn install --immutable
60+
61+
outputs:
62+
dependency_cache_key: ${{ steps.compute_lockfile_hash.outputs.hash }}
63+
yarn_cache_dir_path: |
64+
${{ steps.yarn-cache-dir-path.outputs.dir }}
65+
${{ env.CACHED_DEPENDENCY_PATHS }}
66+
67+
continuous-integration:
68+
name: check lint
69+
needs: [job_install_dependencies]
70+
runs-on: ubuntu-latest
71+
steps:
72+
- name: Check out current commit (${{ github.sha }})
73+
uses: actions/checkout@v4
74+
with:
75+
fetch-depth: 0
76+
- name: Set up Node
77+
uses: actions/setup-node@v4
78+
with:
79+
node-version: ${{ env.DEFAULT_NODE_VERSION }}
80+
81+
- name: Check dependency cache
82+
uses: actions/cache@v4
83+
with:
84+
path: ${{ needs.job_install_dependencies.outputs.yarn_cache_dir_path }}
85+
key: ${{ needs.job_install_dependencies.outputs.dependency_cache_key }}
86+
87+
- name: Check Lint
88+
if: ${{ github.event_name == 'pull_request' }}
89+
run: yarn run eslint $(git diff --name-only --diff-filter=d origin/main | grep -E '(.js$|.jsx|.ts$|.tsx$)')

0 commit comments

Comments
 (0)