Skip to content

Commit

Permalink
chore: simplify github actions and workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
PHILLIPS71 committed Jun 19, 2024
1 parent f6f95bb commit c458ba3
Show file tree
Hide file tree
Showing 12 changed files with 73 additions and 147 deletions.
14 changes: 0 additions & 14 deletions .github/actions/build/action.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: '🔺️ '
name: "🔺️ "

runs:
using: 'composite'
using: "composite"
steps:
- name: '🔺️ Cache (store directory)'
- name: "🔺️ Cache (store directory)"
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: '🔺️ Cache'
- name: "🔺️ Cache"
uses: actions/cache@v4
with:
path: ${{ env.STORE_PATH }}
Expand Down
9 changes: 0 additions & 9 deletions .github/actions/install/action.yml

This file was deleted.

9 changes: 0 additions & 9 deletions .github/actions/lint/action.yml

This file was deleted.

31 changes: 31 additions & 0 deletions .github/actions/setup-node/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: "💽️ "

inputs:
node-version:
default: "20"
description: "🔢 Node version"
required: true
pnpm-version:
default: "8"
description: "🔢 pnpm version"
required: true

runs:
using: "composite"
steps:
- name: "🔧 pnpm"
uses: pnpm/action-setup@v3
with:
version: ${{ inputs.pnpm-version }}

- name: "💽️ Node ${{ inputs.node-version }}"
uses: actions/setup-node@v4
with:
registry-url: "https://registry.npmjs.org"
node-version: ${{ inputs.node-version }}
cache: "pnpm"
cache-dependency-path: ./app/pnpm-lock.yaml

- name: "⚡️ Turbo"
shell: bash
run: pnpm add -g turbo
27 changes: 0 additions & 27 deletions .github/actions/setup/action.yml

This file was deleted.

14 changes: 0 additions & 14 deletions .github/actions/test/action.yml

This file was deleted.

14 changes: 0 additions & 14 deletions .github/actions/type-check/action.yml

This file was deleted.

2 changes: 0 additions & 2 deletions .github/workflows/pr-title.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: '📝 PR Title'

on:
pull_request_target:
branches:
- main

jobs:
main:
Expand Down
30 changes: 12 additions & 18 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: '🔀 Pull Request'

on:
pull_request:
types: [opened, reopened, synchronize]

concurrency:
group: pull-request-${{ github.event.pull_request.number }}
Expand All @@ -20,28 +19,23 @@ jobs:
uses: actions/checkout@v4

- name: '💽️ Setup'
uses: ./.github/actions/setup
uses: ./.github/actions/setup-node

- name: '🔺️ Cache'
uses: ./.github/actions/cache
uses: ./.github/actions/cache-node

- name: '📦 Install'
uses: ./.github/actions/install

- name: '🏗️ Build'
uses: ./.github/actions/build
with:
COMMAND: 'build'
shell: bash
run: pnpm install --frozen-lockfile

- name: '🚨️ Lint'
uses: ./.github/actions/lint
shell: bash
run: pnpm lint

- name: '🎨 Format'
shell: bash
run: pnpm format

- name: '🦺 Type Check'
uses: ./.github/actions/type-check
with:
COMMAND: 'type-check'

- name: '🧪 Test'
uses: ./.github/actions/test
with:
COMMAND: 'test'
shell: bash
run: pnpm typecheck
36 changes: 13 additions & 23 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,9 @@ name: '▶️ Push'

on:
push:
branches:
- main
- chore/**
- feat/**
- fix/**

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

jobs:
Expand All @@ -24,28 +19,23 @@ jobs:
uses: actions/checkout@v4

- name: '💽️ Setup'
uses: ./.github/actions/setup
uses: ./.github/actions/setup-node

- name: '🔺️ Cache'
uses: ./.github/actions/cache
uses: ./.github/actions/cache-node

- name: '📦 Install'
uses: ./.github/actions/install

- name: '🏗️ Build'
uses: ./.github/actions/build
with:
COMMAND: 'build'
shell: bash
run: pnpm install --frozen-lockfile

- name: '🚨️ Lint'
uses: ./.github/actions/lint
shell: bash
run: pnpm lint

- name: '🎨 Format'
shell: bash
run: pnpm format

- name: '🦺 Type Check'
uses: ./.github/actions/type-check
with:
COMMAND: 'type-check'

- name: '🧪 Test'
uses: ./.github/actions/test
with:
COMMAND: 'test'
shell: bash
run: pnpm typecheck
26 changes: 13 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,18 @@ jobs:
uses: actions/checkout@v4

- name: '💽️ Setup'
uses: ./.github/actions/setup
uses: ./.github/actions/setup-node

- name: '🔺️ Cache'
uses: ./.github/actions/cache
uses: ./.github/actions/cache-node

- name: '📦 Install'
uses: ./.github/actions/install
shell: bash
run: pnpm install --frozen-lockfile

- name: '🏗️ Build'
uses: ./.github/actions/build
with:
COMMAND: 'build'
shell: bash
run: pnpm build

- name: '🏷️ Release'
id: release
Expand All @@ -67,18 +67,18 @@ jobs:
ref: ${{ needs.create-release.outputs.branch }}

- name: '💽️ Setup'
uses: ./.github/actions/setup
uses: ./.github/actions/setup-node

- name: '🔺️ Cache'
uses: ./.github/actions/cache
uses: ./.github/actions/cache-node

- name: '📦 Install'
uses: ./.github/actions/install
shell: bash
run: pnpm install --frozen-lockfile

- name: '🏗️ Build'
uses: ./.github/actions/build
with:
COMMAND: 'build'
shell: bash
run: pnpm build

- name: '🏷️ Publish @giantnodes/theme'
working-directory: packages/theme
Expand Down Expand Up @@ -110,7 +110,7 @@ jobs:
uses: thomaseizinger/create-pull-request@master
with:
title: 'chore(release): v${{ needs.create-release.outputs.version }}'
labels: '🏷️ Release, 🥳️ LGTM'
labels: '🏷️ Release'
github_token: ${{ secrets.GITHUB_TOKEN }}
head: release/${{ needs.create-release.outputs.version }}
base: main

0 comments on commit c458ba3

Please sign in to comment.