Skip to content

Commit

Permalink
Consolidate CI test/release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
edspencer committed Aug 22, 2024
1 parent 78473bb commit a172371
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 36 deletions.
5 changes: 5 additions & 0 deletions .changeset/blue-dancers-jump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"inform-ai": patch
---

CI changes
38 changes: 34 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,47 @@
name: Release
name: Test and Release

on:
push:
branches:
- main
- '**' # Runs on all branches

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

jobs:
test:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x, 20.x, 22.x]

steps:
- name: Checkout code
uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
with:
version: 9.7.0

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"

- name: Install dependencies
run: pnpm install

- name: Run tests
run: npx jest

release:
name: Release
runs-on: ubuntu-latest
needs: test
if: github.ref == 'refs/heads/main' # Only run this job on the main branch
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand All @@ -33,7 +64,6 @@ jobs:
id: changesets
uses: changesets/action@v1
with:
# This expects you to have a script called release which does a build for your packages and calls changeset publish
publish: npm run ci:publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
32 changes: 0 additions & 32 deletions .github/workflows/test.yml

This file was deleted.

0 comments on commit a172371

Please sign in to comment.