Skip to content

Commit 0da1911

Browse files
committed
chore: initial CI
1 parent dc9253b commit 0da1911

File tree

5 files changed

+138
-0
lines changed

5 files changed

+138
-0
lines changed

.github/actions/setup/action.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: 'Setup'
2+
description: 'Setup repo and install dependencies'
3+
4+
runs:
5+
using: 'composite'
6+
steps:
7+
- name: Setup pnpm
8+
uses: pnpm/action-setup@v4
9+
10+
- name: Setup Node.js
11+
uses: actions/setup-node@v4
12+
with:
13+
node-version-file: '.nvmrc'
14+
cache: 'pnpm'
15+
16+
- name: Install Dependencies
17+
shell: bash
18+
run: pnpm install --frozen-lockfile

.github/actions/tests/action.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: 'Test Workflow'
2+
description: 'Run tests against a specified environment'
3+
4+
inputs:
5+
environment:
6+
description: 'Environment to run tests against'
7+
required: true
8+
default: 'staging'
9+
10+
runs:
11+
using: 'composite'
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Setup Repository
16+
uses: ./.github/actions/setup
17+
18+
- name: Build
19+
shell: bash
20+
run: pnpm build
21+
22+
- name: Setup Environment Variables
23+
shell: bash
24+
run: |
25+
echo "ENVIRONMENT=${{ inputs.environment }}" >> .env
26+
27+
- name: Run Tests
28+
shell: bash
29+
run: pnpm test

.github/workflows/cd.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Continuous Deployment
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
9+
cancel-in-progress: true
10+
11+
jobs:
12+
verify:
13+
name: Verify
14+
uses: ./.github/workflows/verify.yml
15+
secrets: inherit
16+
17+
# publish:
18+
# name: Publish Snapshot
19+
# runs-on: ubuntu-latest
20+
# needs: verify
21+
22+
# steps:
23+
# - uses: actions/checkout@v4
24+
25+
# - name: Setup Repository
26+
# uses: ./.github/actions/setup
27+
28+
# - name: Configure NPM Auth Token
29+
# run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NODE_AUTH_TOKEN }}" >> ~/.npmrc
30+
31+
# - name: Create Snapshot
32+
# id: create_snapshot
33+
# run: pnpm changeset version --snapshot canary || echo "No unreleased changesets found"
34+
35+
# - name: Check for Changeset
36+
# id: check_changeset
37+
# run: echo "changeset_exists=$(grep -q 'No unreleased changesets found' <<< '${{ steps.create_snapshot.outputs.stdout }}' && echo false || echo true)" >> $GITHUB_ENV
38+
39+
# - name: Build
40+
# if: env.changeset_exists == 'true'
41+
# run: pnpm build
42+
43+
# - name: Publish Snapshot
44+
# if: env.changeset_exists == 'true'
45+
# run: pnpm changeset publish --snapshot --tag canary --no-git-tag

.github/workflows/pull-request.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Pull Request
2+
on:
3+
workflow_dispatch:
4+
pull_request:
5+
branches: [main]
6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
9+
cancel-in-progress: true
10+
11+
jobs:
12+
verify:
13+
name: Verify
14+
uses: ./.github/workflows/verify.yml
15+
secrets: inherit

.github/workflows/verify.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: 'Verify'
2+
on:
3+
workflow_call:
4+
5+
jobs:
6+
lint:
7+
name: Lint
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v4
12+
13+
- name: Setup Biome
14+
uses: biomejs/setup-biome@v2
15+
with:
16+
version: 2.0.6
17+
18+
- name: Run Biome
19+
run: biome ci .
20+
21+
test:
22+
name: Test
23+
runs-on: ubuntu-latest
24+
25+
steps:
26+
- uses: actions/checkout@v4
27+
28+
- name: Run Tests
29+
uses: ./.github/actions/tests
30+
with:
31+
environment: 'staging'

0 commit comments

Comments
 (0)