Skip to content

Commit

Permalink
feat: replace label check with path check
Browse files Browse the repository at this point in the history
  • Loading branch information
2wheeh committed Sep 21, 2023
1 parent ff3b1b6 commit aea32d1
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 30 deletions.
60 changes: 30 additions & 30 deletions .github/workflows/run-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,33 +30,33 @@ jobs:
working-directory: ./api
run: |
npm run test:cov
ui-test:
if: contains(github.event.pull_request.labels.*.name, 'ui')
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: |
.github
ui
fetch-depth: 2
- name: Tag baseRef
run: |
git tag baseRef HEAD^1
- name: Read .nvmrc
working-directory: ./ui
run: |
echo "NODE_VERSION=$(cat .nvmrc)" >> $GITHUB_OUTPUT
id: nvm
- name: Use Node.js ${{ steps.nvm.outputs.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: ${{ steps.nvm.outputs.NODE_VERSION }}
- name: Install dependencies
working-directory: ./ui
run: |
yarn install --immutable
- name: Run UI unit tests on affected packages
working-directory: ./ui
run: |
yarn test:affected
# ui-test:
# if: contains(github.event.pull_request.labels.*.name, 'ui')
# runs-on: ubuntu-22.04
# steps:
# - uses: actions/checkout@v4
# with:
# sparse-checkout: |
# .github
# ui
# fetch-depth: 2
# - name: Tag baseRef
# run: |
# git tag baseRef HEAD^1
# - name: Read .nvmrc
# working-directory: ./ui
# run: |
# echo "NODE_VERSION=$(cat .nvmrc)" >> $GITHUB_OUTPUT
# id: nvm
# - name: Use Node.js ${{ steps.nvm.outputs.NODE_VERSION }}
# uses: actions/setup-node@v3
# with:
# node-version: ${{ steps.nvm.outputs.NODE_VERSION }}
# - name: Install dependencies
# working-directory: ./ui
# run: |
# yarn install --immutable
# - name: Run UI unit tests on affected packages
# working-directory: ./ui
# run: |
# yarn test:affected
41 changes: 41 additions & 0 deletions .github/workflows/ui-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: UI Test

on:
pull_request:
branches:
- main
- 'develop'
paths:
- 'ui/**'
workflow_dispatch:

jobs:
ui-test:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: |
.github
ui
fetch-depth: 2
- name: Tag baseRef
run: |
git tag baseRef HEAD^1
- name: Read .nvmrc
working-directory: ./ui
run: |
echo "NODE_VERSION=$(cat .nvmrc)" >> $GITHUB_OUTPUT
id: nvm
- name: Use Node.js ${{ steps.nvm.outputs.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: ${{ steps.nvm.outputs.NODE_VERSION }}
- name: Install dependencies
working-directory: ./ui
run: |
yarn install --immutable
- name: Run UI unit tests on affected packages
working-directory: ./ui
run: |
yarn test:affected

0 comments on commit aea32d1

Please sign in to comment.