diff --git a/.github/workflows/pr-preview.yml b/.github/workflows/pr-preview.yml index 750c5c58..3bdf9cce 100644 --- a/.github/workflows/pr-preview.yml +++ b/.github/workflows/pr-preview.yml @@ -2,8 +2,6 @@ name: PR Preview on: pull_request: - branches: - - main jobs: build-and-deploy: @@ -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 }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 28f84b21..00000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: test -on: [push, pull_request] - -jobs: - run: - 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 }} diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml new file mode 100644 index 00000000..82efe44d --- /dev/null +++ b/.github/workflows/unit-test.yml @@ -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 }}