From db5786f2f090c2a62d86922e2a7d367dd0047518 Mon Sep 17 00:00:00 2001 From: Dong-Ha Kim Date: Sun, 4 Feb 2024 10:56:15 +0100 Subject: [PATCH] ci: setup gha --- .github/actions/setup/action.yaml | 21 +++++++++++++++++++++ .github/workflows/lint.yaml | 25 +++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 .github/actions/setup/action.yaml create mode 100644 .github/workflows/lint.yaml diff --git a/.github/actions/setup/action.yaml b/.github/actions/setup/action.yaml new file mode 100644 index 0000000..966e5dd --- /dev/null +++ b/.github/actions/setup/action.yaml @@ -0,0 +1,21 @@ +name: Setup +runs: + using: composite + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-node@v3 + with: + node-version: 18 + registry-url: https://registry.npmjs.org + cache: yarn + + - uses: actions/cache@v3 + id: yarn-cache + with: + path: node_modules/ + key: ${{ runner.os }}-install-${{ hashFiles('**/yarn.lock') }} + + - if: steps.yarn-cache.outputs.cache-hit != 'true' + run: yarn install --frozen-lockfile --ignore-scripts + shell: bash diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml new file mode 100644 index 0000000..4d0caf2 --- /dev/null +++ b/.github/workflows/lint.yaml @@ -0,0 +1,25 @@ +name: Lint + +on: + # manual trigger + workflow_dispatch: + push: + branches: + - master + - main + pull_request: + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/setup + - run: yarn lint + + format: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/setup + - run: yarn format:check