From ca0db97d5a23cab2460b0b3c79c2a0f0e497f143 Mon Sep 17 00:00:00 2001 From: Aleksei Potsetsuev Date: Thu, 12 Sep 2024 19:39:29 +0800 Subject: [PATCH] feat: update github workflows --- .github/workflows/build-docs.yml | 15 ++++----------- .github/workflows/coverage-report.yml | 1 - .github/workflows/push-main.yml | 2 +- .github/workflows/release.yml | 8 +++----- .github/workflows/test.yml | 10 +++------- 5 files changed, 11 insertions(+), 25 deletions(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index c569d6d..37011b7 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -21,8 +21,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v4 + - uses: actions/checkout@v4 with: fetch-depth: 0 # Not needed if lastUpdated is not enabled @@ -32,11 +31,8 @@ jobs: node-version: "lts/*" cache: "yarn" - - name: Setup Pages - uses: actions/configure-pages@v4 - - - name: Install modules - run: yarn install --immutable + - uses: actions/configure-pages@v4 + - run: yarn install --immutable - name: Download build artifacts uses: actions/download-artifact@v4 @@ -47,7 +43,6 @@ jobs: - name: Build run: yarn run docs:build - working-directory: ./packages/docs - name: Upload artifact uses: actions/upload-pages-artifact@v3 @@ -61,8 +56,6 @@ jobs: url: ${{ steps.deployment.outputs.page_url }} needs: build runs-on: ubuntu-latest - name: Deploy steps: - - name: Deploy to GitHub Pages + - uses: actions/deploy-pages@v4 id: deployment - uses: actions/deploy-pages@v4 diff --git a/.github/workflows/coverage-report.yml b/.github/workflows/coverage-report.yml index 7afb431..cad0110 100644 --- a/.github/workflows/coverage-report.yml +++ b/.github/workflows/coverage-report.yml @@ -17,7 +17,6 @@ jobs: - uses: actions/checkout@v4 - name: Sanitize branch name - id: sanitize_branch run: | # Replace invalid characters with a dash '-' SANITIZED_BRANCH=$(echo "${{ github.event.workflow_run.head_branch }}" | sed 's/[\/\\:*?"<>|]/-/g') diff --git a/.github/workflows/push-main.yml b/.github/workflows/push-main.yml index b7e21b7..cf57c31 100644 --- a/.github/workflows/push-main.yml +++ b/.github/workflows/push-main.yml @@ -20,7 +20,7 @@ jobs: with: build-run-id: ${{ needs.build.outputs.run-id }} - build-docs: + docs: needs: build uses: ./.github/workflows/build-docs.yml secrets: inherit diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bf2dfe8..7e552be 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,7 +13,6 @@ permissions: jobs: release: - name: Release runs-on: ubuntu-latest timeout-minutes: 10 permissions: @@ -25,14 +24,14 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 + - run: corepack enable - uses: actions/setup-node@v4 with: node-version: "lts/*" cache: "yarn" - - name: Install modules - run: yarn install --immutable + - run: yarn install --immutable - name: Download build artifacts uses: actions/download-artifact@v4 @@ -75,8 +74,7 @@ jobs: yarn config set npmPublishRegistry "https://registry.npmjs.org" yarn config set npmAuthToken $NPM_AUTH_TOKEN - - name: Install modules - run: yarn install --immutable + - run: yarn install --immutable - name: Download build artifacts uses: actions/download-artifact@v4 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 23502f7..b551952 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,19 +24,15 @@ jobs: - run: corepack enable - uses: actions/setup-node@v4 with: - node-version: 20 + node-version: "lts/*" cache: "yarn" - - name: Install modules - run: yarn install --immutable - - - name: Build and test modules - run: | + - run: | + yarn install --immutable yarn build yarn test:ci - name: Sanitize branch name - id: sanitize_branch run: | # Replace invalid characters with a dash '-' SANITIZED_BRANCH=$(echo "${{ matrix.branch }}" | sed 's/[\/\\:*?"<>|]/-/g')