Skip to content

Commit

Permalink
refactor(github/workflow): use javascript-project-setup reusable work… (
Browse files Browse the repository at this point in the history
#3)

refactor(github/workflow): use javascript-project-setup reusable workflow
  • Loading branch information
njfamirm committed Dec 30, 2024
1 parent 8ff98c9 commit 0411a49
Showing 1 changed file with 15 additions and 34 deletions.
49 changes: 15 additions & 34 deletions .github/workflows/build-lint-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,57 +12,38 @@ on:
- next

env:
NODE_VERSION: lts/*
NODE_VERSION: 22.11.0


permissions:
actions: read
contents: read

jobs:
setup:
uses: the-nexim/actions/.github/workflows/javascript-project-setup.yaml@next
with:
node_version: ${{ env.NODE_VERSION }}

main:
name: Build & Lint & Test
runs-on: ubuntu-latest

permissions:
contents: read

steps:
- name: ⤵️ Checkout repository
uses: actions/checkout@v4

- name: 🏗 Setup nodejs
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}

- name: 🏗 Setup nodejs corepack
run: corepack enable

- name: 🏗 Get yarn config
id: yarn_config
run: echo "cache_folder=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT

- name: 🏗 Cache Layer
uses: actions/cache@v4
with:
path: ${{ steps.yarn_config.outputs.cache_folder }}
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: 🏗 Install dependencies
run: yarn install --immutable

- name: 🏗 Cache Wireit
- name: 📦 Cache Wireit
uses: google/wireit@setup-github-actions-caching/v2

- name: 🚀 Build Typescript
- name: 🏗️ Build Typescript
run: yarn build
env:
WIREIT_LOGGER: metrics

- name: 🚀 Run ESLint
- name: 🧹 Run ESLint
run: yarn lint
env:
WIREIT_LOGGER: metrics

- name: 🚀 Run Test
- name: 🧪 Run Test
run: yarn test
env:
WIREIT_LOGGER: metrics

0 comments on commit 0411a49

Please sign in to comment.