Skip to content

Commit

Permalink
♻️ 👷 DRY common yarn setup steps into local action (#158)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheAfroOfDoom authored Aug 31, 2024
1 parent ca9e1b8 commit b0e36f1
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 48 deletions.
20 changes: 20 additions & 0 deletions .github/actions/setup-yarn/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Setup Yarn
description: Common setup steps for most workflows in the Omega Flowey Remastered repository

runs:
using: composite
steps:
- uses: tw3lveparsecs/[email protected]
with:
envFilePath: ./.github/variables/shared.env
- name: Install Yarn 3.6.3
run: corepack enable
shell: bash
- name: Setup cache
uses: actions/setup-node@v4
with:
cache: 'yarn'
cache-dependency-path: yarn.lock
node-version-file: package.json
- run: yarn
shell: bash
13 changes: 1 addition & 12 deletions .github/workflows/datapack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: tw3lveparsecs/[email protected]
with:
envFilePath: ./.github/variables/shared.env
- name: Install Yarn 3.6.3
run: corepack enable
- name: Setup cache
uses: actions/setup-node@v4
with:
cache: 'yarn'
cache-dependency-path: yarn.lock
node-version-file: package.json
- run: yarn
- uses: ./.github/actions/setup-yarn
- name: Run lint scripts on datapacks
run: yarn start lint.custom.datapacks
env:
Expand Down
13 changes: 1 addition & 12 deletions .github/workflows/resourcepack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: tw3lveparsecs/[email protected]
with:
envFilePath: ./.github/variables/shared.env
- name: Install Yarn 3.6.3
run: corepack enable
- name: Setup cache
uses: actions/setup-node@v4
with:
cache: 'yarn'
cache-dependency-path: yarn.lock
node-version-file: package.json
- run: yarn
- uses: ./.github/actions/setup-yarn
- name: Run lint scripts on resourcepack
run: yarn start lint.custom.resourcepack
env:
Expand Down
26 changes: 2 additions & 24 deletions .github/workflows/scripts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: tw3lveparsecs/[email protected]
with:
envFilePath: ./.github/variables/shared.env
- name: Install Yarn 3.6.3
run: corepack enable
- name: Setup cache
uses: actions/setup-node@v4
with:
cache: 'yarn'
cache-dependency-path: yarn.lock
node-version-file: package.json
- run: yarn
- uses: ./.github/actions/setup-yarn
- name: Run Prettier
run: yarn start lint.scripts.prettier.check

Expand All @@ -27,18 +16,7 @@ jobs:
needs: format
steps:
- uses: actions/checkout@v4
- uses: tw3lveparsecs/[email protected]
with:
envFilePath: ./.github/variables/shared.env
- name: Install Yarn 3.6.3
run: corepack enable
- name: Setup cache
uses: actions/setup-node@v4
with:
cache: 'yarn'
cache-dependency-path: yarn.lock
node-version-file: package.json
- run: yarn
- uses: ./.github/actions/setup-yarn
- name: Run ESLint
run: yarn start lint.scripts.eslint.check
- name: Run custom lint scripts on non-datapacks, non-resourcepack files
Expand Down

0 comments on commit b0e36f1

Please sign in to comment.