Skip to content

Commit

Permalink
improve CI setup
Browse files Browse the repository at this point in the history
  • Loading branch information
gossi committed Jan 18, 2025
1 parent 04e6f4a commit b6e7458
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 23 deletions.
27 changes: 27 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: 'Setup'
runs:
using: 'composite'
steps:
- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
cache: 'pnpm'
# This creates an .npmrc that reads the NODE_AUTH_TOKEN environment variable
# necessary for publish
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: pnpm install
shell: bash

- name: Build Theme
run: pnpm build
working-directory: theme

- name: Build Tina
run: pnpm exec tinacms build --local --skip-cloud-checks
working-directory: web
39 changes: 16 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,9 @@ jobs:
name: Lint (JS)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup
uses: wyvox/action@v1

# build tina stuff
- name: Build Tina
run: pnpm exec tinacms build --local --skip-cloud-checks
working-directory: web
uses: ./.github/actions/setup

- name: Lint
run: pnpm run lint:js
Expand All @@ -39,29 +35,31 @@ jobs:
name: Lint (Types)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup
uses: wyvox/action@v1
uses: ./.github/actions/setup

# build tina stuff
- name: Build Tina
run: pnpm exec tinacms build --local --skip-cloud-checks
- name: Lint
run: pnpm run lint:types
working-directory: web

lint-css:
name: Lint (CSS)
runs-on: ubuntu-latest
steps:
- name: Setup
uses: ./.github/actions/setup

- name: Lint
run: pnpm run lint:types
run: pnpm run lint:css
working-directory: web

lint-hbs:
name: Lint (HBS)
runs-on: ubuntu-latest
steps:
- name: Setup
uses: wyvox/action@v1

# build tina stuff
- name: Build Tina
run: pnpm exec tinacms build --local --skip-cloud-checks
working-directory: web
uses: ./.github/actions/setup

- name: Lint
run: pnpm run lint:hbs
Expand All @@ -72,12 +70,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Setup
uses: wyvox/action@v1

# build tina stuff
- name: Build Tina
run: pnpm exec tinacms build --local --skip-cloud-checks
working-directory: web
uses: ./.github/actions/setup

# - name: Lint JS
# run: pnpm run -r --parallel --aggregate-output lint:js
Expand Down

0 comments on commit b6e7458

Please sign in to comment.