Merge pull request #49 from decs/pr49 #218
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
env: | |
TURBO_TOKEN: ${{secrets.TURBO_TOKEN}} | |
TURBO_TEAM: ${{vars.TURBO_TEAM}} | |
jobs: | |
gen: | |
name: Check generated code | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v4 | |
- name: Setup requirements | |
uses: ./.github/actions/setup | |
- name: Re-generate code | |
run: pnpm gen | |
- name: Check for uncommitted changes | |
id: changes | |
uses: UnicornGlobal/[email protected] | |
- name: Fail if uncommitted changes | |
if: steps.changes.outputs.changed == 1 | |
run: exit 1 | |
lint: | |
name: Lint packages | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v4 | |
- name: Setup requirements | |
uses: ./.github/actions/setup | |
- name: Lint packages | |
run: pnpm lint | |
- name: Check for uncommitted changes | |
id: changes | |
uses: UnicornGlobal/[email protected] | |
- name: Fail if uncommitted changes | |
if: steps.changes.outputs.changed == 1 | |
run: exit 1 | |
test: | |
name: Run tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v4 | |
- name: Setup requirements | |
uses: ./.github/actions/setup | |
- name: Run tests | |
run: pnpm test | |
test-e2e: | |
name: Run e2e tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v4 | |
- name: Setup requirements | |
uses: ./.github/actions/setup | |
- name: Run e2e tests | |
run: pnpm test:e2e | |
release: | |
name: Release packages | |
if: github.event_name == 'push' && github.ref_name == 'main' | |
runs-on: ubuntu-latest | |
needs: [gen, lint, test, test-e2e] | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v4 | |
- name: Setup requirements | |
uses: ./.github/actions/setup | |
- name: Release packages | |
uses: changesets/action@v1 | |
with: | |
publish: pnpm release | |
commit: 'chore(release): version packages' | |
title: 'chore(release): version packages' | |
env: | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
NPM_TOKEN: ${{secrets.NPM_TOKEN}} |