Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 84 additions & 0 deletions .github/actions/pass.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: 'Pass Action'
description: 'Run common checks for the project (lint, format, type check, test, build)'
outputs:
all_pass:
description: 'Whether all checks passed'
value: ${{ steps.check_results.outputs.all_pass }}

runs:
using: 'composite'
steps:
- name: Setup Node.js 20.x for corepack
uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org/'
scope: '@ummgoban'

- name: Enable Corepack and Set yarn Version
shell: bash
run: |
npm install -g corepack@latest
corepack enable

- name: Setup Node.js 20.x for yarn
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: yarn

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

- name: Lint
id: lint_check
shell: bash
continue-on-error: true
run: |
yarn lint:check
echo $? > lint_result

- name: Format
id: format_check
shell: bash
continue-on-error: true
run: |
yarn format:check
echo $? > format_result

- name: Type Check
id: type_check
shell: bash
continue-on-error: true
run: |
yarn type-check
echo $? > type_result

- name: Test
id: test_check
shell: bash
continue-on-error: true
run: |
yarn test
echo $? > test_result

- name: Build
id: build
shell: bash
continue-on-error: true
run: |
yarn build
echo $? > build_result

- name: Check Lint & Format & Type Check & Test & Build Results
id: check_results
shell: bash
run: |
if [ "$(cat lint_result)" -eq 0 ] && [ "$(cat format_result)" -eq 0 ] && [ "$(cat type_result)" -eq 0 ] && [ "$(cat test_result)" -eq 0 ] && [ "$(cat build_result)" -eq 0 ]; then
echo "all_pass=true" >> $GITHUB_OUTPUT
echo "all_pass=true" >> $GITHUB_ENV
else
echo "all_pass=false" >> $GITHUB_OUTPUT
echo "all_pass=false" >> $GITHUB_ENV
fi
70 changes: 6 additions & 64 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,68 +27,10 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js 20.x for corepack
uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://npm.pkg.github.com'
scope: '@ummgoban'
- name: Run common checks
id: pass
uses: ./.github/actions/pass.yml

- name: Enable Corepack and Set yarn Version
run: |
npm install -g corepack@latest
corepack enable

- name: Setup Node.js 20.x for yarn
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: yarn

- name: Install dependencies
run: yarn install

- name: Lint
id: lint_check
continue-on-error: true
run: |
yarn lint:check
echo $? > lint_result

- name: Format
id: format_check
continue-on-error: true
run: |
yarn format:check
echo $? > format_result

- name: Type Check
id: type_check
continue-on-error: true
run: |
yarn type-check
echo $? > type_result

- name: Test
id: test_check
continue-on-error: true
run: |
yarn test
echo $? > test_result

- name: Build
id: build
continue-on-error: true
run: |
yarn build
echo $? > build_result

- name: Check Lint & Format & Type Check & Test & Build Results
id: check_results
run: |
if [ "$(cat lint_result)" -eq 0 ] && [ "$(cat format_result)" -eq 0 ] && [ "$(cat type_result)" -eq 0 ] && [ "$(cat test_result)" -eq 0 ] && [ "$(cat build_result)" -eq 0 ]; then
echo "all_pass=true" >> $GITHUB_ENV
else
echo "all_pass=false" >> $GITHUB_ENV
exit 1
fi
- name: Check results
if: steps.pass.outputs.all_pass != 'true'
run: exit 1
69 changes: 4 additions & 65 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,73 +77,12 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js 20.x for corepack
uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org/'
scope: '@ummgoban'

- name: Enable Corepack and Set yarn Version
run: |
npm install -g corepack@latest
corepack enable

- name: Setup Node.js 20.x for yarn
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: yarn

- name: Install dependencies
run: yarn install

- name: Lint
id: lint_check
continue-on-error: true
run: |
yarn lint:check
echo $? > lint_result

- name: Format
id: format_check
continue-on-error: true
run: |
yarn format:check
echo $? > format_result

- name: Type Check
id: type_check
continue-on-error: true
run: |
yarn type-check
echo $? > type_result

- name: Test
id: test_check
continue-on-error: true
run: |
yarn test
echo $? > test_result

- name: Build
id: build
continue-on-error: true
run: |
yarn build
echo $? > build_result

- name: Check Lint & Format & Type Check & Test & Build Results
id: check_results
run: |
if [ "$(cat lint_result)" -eq 0 ] && [ "$(cat format_result)" -eq 0 ] && [ "$(cat type_result)" -eq 0 ] && [ "$(cat test_result)" -eq 0 ] && [ "$(cat build_result)" -eq 0 ]; then
echo "all_pass=true" >> $GITHUB_ENV
else
echo "all_pass=false" >> $GITHUB_ENV
fi
- name: Run common checks
id: pass
uses: ./.github/actions/pass.yml

- name: Publish
if: env.all_pass == 'true'
if: steps.pass.outputs.all_pass == 'true'
run: |
# create .env
echo "NPM_TOKEN=${{ secrets.NPM_TOKEN }}" > .env
Expand Down