Skip to content

Commit

Permalink
chore: restructure workflow for site builds and deployments (#307)
Browse files Browse the repository at this point in the history
* feat: restructure GitHub Actions workflow for site builds and deployments

* feat: consolidate site build jobs into a single concurrent step in GitHub Actions workflow

* feat: removing obsolete test workflow and adding unit test workflow

* feat: rename job from 'run' to 'run-test' in unit test workflow
  • Loading branch information
adaex authored Dec 20, 2024
1 parent 4a5c0f8 commit 8dae4c8
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 41 deletions.
20 changes: 6 additions & 14 deletions .github/workflows/pr-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: PR Preview

on:
pull_request:
branches:
- main

jobs:
build-and-deploy:
Expand All @@ -24,18 +22,12 @@ jobs:
- name: Set ARCO_SITE_DOMAIN
run: echo "ARCO_SITE_DOMAIN=preview-${{ github.event.number }}-arco-design-mobile.surge.sh" >> $GITHUB_ENV

- name: Build site:home
run: npm run site:home
env:
ARCO_SITE_DOMAIN: ${{ env.ARCO_SITE_DOMAIN }}

- name: Build site:pc
run: npm run site:pc
env:
ARCO_SITE_DOMAIN: ${{ env.ARCO_SITE_DOMAIN }}

- name: Build site:mobile
run: npm run site:mobile
- name: Build sites concurrently
run: |
npm run site:home &
npm run site:pc &
npm run site:mobile &
wait
env:
ARCO_SITE_DOMAIN: ${{ env.ARCO_SITE_DOMAIN }}

Expand Down
27 changes: 0 additions & 27 deletions .github/workflows/test.yml

This file was deleted.

31 changes: 31 additions & 0 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Unit Test
on:
push:
branches:
- main
pull_request:

jobs:
run-test:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: setup node
uses: actions/setup-node@v2
with:
node-version: 16

- name: install
run: npm install

- name: test and collect coverage
run: npm run test

- name: upload coverage to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

0 comments on commit 8dae4c8

Please sign in to comment.