From 640a560f94221a2c8f5e03dbd0822c2a724f6154 Mon Sep 17 00:00:00 2001 From: Alessandro Yuichi Okimoto Date: Fri, 9 Aug 2024 15:37:23 +0900 Subject: [PATCH] ci: add workflow for ui/dashboard Signed-off-by: Alessandro Yuichi Okimoto --- .github/workflows/pr-ui-dashboard.yaml | 99 ++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 .github/workflows/pr-ui-dashboard.yaml diff --git a/.github/workflows/pr-ui-dashboard.yaml b/.github/workflows/pr-ui-dashboard.yaml new file mode 100644 index 000000000..17d67304b --- /dev/null +++ b/.github/workflows/pr-ui-dashboard.yaml @@ -0,0 +1,99 @@ +name: pr-ui-dashboard + +on: + pull_request: + branches: + - main + - feat/renew-dashboard + paths: + - "ui/dashboard/**" + - "!**/**.md" + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +env: + NODE_VERSION: "20.14.10" + WEB_DIRECTORY: "ui/dashboard" + +jobs: + install-dependencies: + defaults: + run: + working-directory: ${{ env.WEB_DIRECTORY }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: ${{ env.NODE_VERSION }} + - name: Set yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + - uses: actions/cache@v4 + id: yarn-cache + with: + path: | + **/node_modules + **/.eslintcache + ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + - name: Install dependencies + run: yarn install + + lint: + needs: install-dependencies + defaults: + run: + working-directory: ${{ env.WEB_DIRECTORY }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: ${{ env.NODE_VERSION }} + - name: Set yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + - uses: actions/cache@v4 + id: yarn-cache + with: + path: | + **/node_modules + **/.eslintcache + ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + - name: Lint + run: yarn style:all + + build: + needs: install-dependencies + defaults: + run: + working-directory: ${{ env.WEB_DIRECTORY }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: ${{ env.NODE_VERSION }} + - name: Set yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + - uses: actions/cache@v4 + id: yarn-cache + with: + path: | + **/node_modules + **/.eslintcache + ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + - name: Build + run: yarn build