Skip to content

Commit

Permalink
ci: add github action pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
junminahn committed Jun 27, 2024
1 parent a087943 commit e22e3f2
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/actions/setup-tools/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Setup Tools
description: Setup required tools in the workspace

runs:
using: composite
steps:
- name: Setup Tools
uses: egose/actions/asdf-tools@6be83b27672d3e09a451e7aeb195781604a124da

- name: Install python tools
run: |
pip install -r requirements.txt
asdf reshim
shell: bash
21 changes: 21 additions & 0 deletions .github/actions/setup-yarn/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Setup NPM Packages
description: Setup required NPM packages

runs:
using: composite
steps:
# See https://github.com/actions/cache/blob/main/examples.md#node---yarn
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install NPM dependencies
run: yarn
shell: bash
42 changes: 42 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Test

on: push

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

jobs:
build-app:
runs-on: ubuntu-22.04
timeout-minutes: 20
steps:
- uses: hmarr/debug-action@f7318c783045ac39ed9bb497e22ce835fdafbfe6
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332

- name: Setup Tools
uses: ./.github/actions/setup-tools

- name: Setup NPM Packages
uses: ./.github/actions/setup-yarn

- name: Run App build
run: npm run build
working-directory: app

pre-commit:
runs-on: ubuntu-22.04
timeout-minutes: 10
steps:
- uses: hmarr/debug-action@f7318c783045ac39ed9bb497e22ce835fdafbfe6
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332

- name: Setup Tools
uses: ./.github/actions/setup-tools

- name: Setup NPM Packages
uses: ./.github/actions/setup-yarn

- name: Rerun Pre-Commit Hooks on CI
run: |
pre-commit run --config=.pre-commit-config.yaml --color=always --show-diff-on-failure --all-files

0 comments on commit e22e3f2

Please sign in to comment.