Skip to content

Commit bbaf75b

Browse files
authored
Merge pull request #63 from sendbird/chore/change-circleci-to-githubaction
[CLNP-7527] add GitHub Actions workflow for build and test process
2 parents 99b2e07 + d0923a0 commit bbaf75b

File tree

6 files changed

+497
-541
lines changed

6 files changed

+497
-541
lines changed

.circleci/config.yml

Lines changed: 0 additions & 115 deletions
This file was deleted.

.github/actions/setup/action.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: 'Setup Environment'
2+
description: 'Common setup steps for all jobs'
3+
inputs:
4+
node-version:
5+
description: 'Node.js version to use'
6+
required: false
7+
default: '20.9.0'
8+
9+
runs:
10+
using: 'composite'
11+
steps:
12+
- name: Setup Node.js
13+
uses: actions/setup-node@v4
14+
with:
15+
node-version: ${{ inputs.node-version }}
16+
cache: 'yarn'
17+
18+
- name: Install dependencies
19+
shell: bash
20+
run: |
21+
yarn install --frozen-lockfile
22+
yarn install --cwd sample --frozen-lockfile
23+
24+
- name: Inject env file
25+
shell: bash
26+
run: |
27+
echo "export const APP_ID = 'app_id';" >> sample/src/env.ts
28+
echo "export const INITIAL_ROUTE = 'route';" >> sample/src/env.ts
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: Build and Test
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- '**'
7+
push:
8+
branches:
9+
- main
10+
11+
jobs:
12+
lint:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Setup environment
19+
uses: ./.github/actions/setup
20+
21+
- name: Run linting
22+
run: yarn lint
23+
24+
typescript:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout code
28+
uses: actions/checkout@v4
29+
30+
- name: Setup environment
31+
uses: ./.github/actions/setup
32+
33+
- name: TypeScript check
34+
run: yarn typescript
35+
36+
sample-typescript:
37+
runs-on: ubuntu-latest
38+
steps:
39+
- name: Checkout code
40+
uses: actions/checkout@v4
41+
42+
- name: Setup environment
43+
uses: ./.github/actions/setup
44+
45+
- name: Sample TypeScript check
46+
run: yarn sample:tsc
47+
48+
unit-tests:
49+
runs-on: ubuntu-latest
50+
steps:
51+
- name: Checkout code
52+
uses: actions/checkout@v4
53+
54+
- name: Setup environment
55+
uses: ./.github/actions/setup
56+
57+
- name: Run unit tests
58+
run: yarn test --coverage
59+
60+
- name: Upload coverage reports
61+
uses: actions/upload-artifact@v4
62+
with:
63+
name: coverage
64+
path: coverage
65+
66+
build-package:
67+
runs-on: ubuntu-latest
68+
steps:
69+
- name: Checkout code
70+
uses: actions/checkout@v4
71+
72+
- name: Setup environment
73+
uses: ./.github/actions/setup
74+
75+
- name: Build package
76+
run: yarn build

0 commit comments

Comments
 (0)