diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 44ddebe7dfb4..e7fe54eb138a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -359,63 +359,10 @@ jobs: # reason for excluding https://github.com/napi-rs/napi-rs/issues/2200 run: cargo miri test --workspace --exclude rspack_node -- --nocapture - run_benchmark: - name: Run benchmark - runs-on: ubuntu-latest - # TODO: enable it after security tokens are added - # if: github.ref_name == 'main' && github.repository_owner == 'web-infra-dev' - if: false - steps: - - name: Run Benchmark - uses: convictional/trigger-workflow-and-wait@v1.6.5 - with: - owner: ${{ github.repository_owner }} - repo: "rspack-ecosystem-benchmark" - workflow_file_name: "bench_rspack_commit.yml" - github_token: ${{ secrets.RSPACK_ACCESS_TOKEN }} - ref: "main" - client_payload: '{"commit_sha":"${{ github.sha }}"}' - - run_ecosystem_ci: - name: Run Ecosystem CI - runs-on: ubuntu-latest - # TODO: enable it after security tokens are added - # if: github.ref_name == 'main' && github.repository_owner == 'web-infra-dev' - if: false - steps: - - name: Run Ecosystem CI - id: eco_ci - continue-on-error: true - uses: convictional/trigger-workflow-and-wait@v1.6.5 - with: - owner: "rspack-contrib" - repo: "rspack-ecosystem-ci" - workflow_file_name: "ecosystem-ci-from-commit.yml" - github_token: ${{ secrets.RSPACK_ACCESS_TOKEN }} - ref: "main" - client_payload: '{"commitSHA":"${{ github.sha }}","repo":"web-infra-dev/rspack","suite":"-","suiteRefType":"precoded","suiteRef":"precoded"}' - - - if: steps.eco_ci.outcome == 'failure' - uses: actions/checkout@v4 - - if: steps.eco_ci.outcome == 'failure' - uses: actions/setup-node@v4 - with: - node-version: 20 - - name: Send Failure Notification - if: steps.eco_ci.outcome == 'failure' - shell: bash - run: ./scripts/alert/lark.js - env: - TITLE: Ecosystem CI failed on main branch - DESCRIPTION: | - commitID: [${{github.sha}}](${{github.server_url}}/${{github.repository}}/commit/${{github.sha}}) - URL: ${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}} - LARK_WEBHOOK_URL: ${{secrets.LARK_WEBHOOK_URL}} - failure_notification: name: Failure Notification needs: - [test-linux, test-windows, test-mac, rust_check, rust_test, run_benchmark] + [test-linux, test-windows, test-mac, rust_check, rust_test] if: ${{ failure() && !cancelled() && github.ref_name == 'main' && github.repository_owner == 'web-infra-dev' }} runs-on: ubuntu-latest steps: diff --git a/.github/workflows/ecosystem-ci-trigger.yml b/.github/workflows/ecosystem-ci-trigger.yml deleted file mode 100644 index 7b74bf81a7b5..000000000000 --- a/.github/workflows/ecosystem-ci-trigger.yml +++ /dev/null @@ -1,102 +0,0 @@ -name: ecosystem-ci trigger - -# TODO: switch to workflow_dispatch -# on: - -jobs: - trigger: - runs-on: ubuntu-latest - if: github.repository == 'web-infra-dev/rspack' && github.event.issue.pull_request && startsWith(github.event.comment.body, '!eco-ci') - steps: - - uses: actions/github-script@v7 - with: - script: | - const user = context.payload.sender.login - console.log(`Validate user: ${user}`) - - let hasTriagePermission = false - try { - const { data } = await github.rest.repos.getCollaboratorPermissionLevel({ - owner: context.repo.owner, - repo: context.repo.repo, - username: user, - }); - hasTriagePermission = data.user.permissions.triage - } catch (e) { - console.warn(e) - } - - if (hasTriagePermission) { - console.log('Allowed') - await github.rest.reactions.createForIssueComment({ - owner: context.repo.owner, - repo: context.repo.repo, - comment_id: context.payload.comment.id, - content: '+1', - }) - } else { - console.log('Not allowed') - await github.rest.reactions.createForIssueComment({ - owner: context.repo.owner, - repo: context.repo.repo, - comment_id: context.payload.comment.id, - content: '-1', - }) - throw new Error('not allowed') - } - - uses: actions/github-script@v7 - id: get-pr-data - with: - script: | - console.log(`Get PR info: ${context.repo.owner}/${context.repo.repo}#${context.issue.number}`) - const { data: pr } = await github.rest.pulls.get({ - owner: context.repo.owner, - repo: context.repo.repo, - pull_number: context.issue.number - }) - return { - num: context.issue.number, - branchName: pr.head.ref, - repo: pr.head.repo.full_name - } - - uses: actions/github-script@v7 - id: trigger - env: - COMMENT: ${{ github.event.comment.body }} - with: - github-token: ${{ secrets.RSPACK_ACCESS_TOKEN }} - result-encoding: string - script: | - const comment = process.env.COMMENT.trim() - const command = comment.split('\n')[0] - const prData = ${{ steps.get-pr-data.outputs.result }} - - const [suite, suiteRefType, suiteRef] = command.replace(/^!eco-ci/, '').trim().split(' ') - const allSuites = suite === '' || suite === '-' - - function normalizeSuiteRefType(suiteRefType) { - const prefix = '--suite-' - if (allSuites || suiteRefType === undefined || !suiteRefType.startsWith(prefix)) { - return 'precoded' - } - return suiteRefType.slice(prefix.length) - } - - function normalizeSuiteRef(suiteRef) { - return (allSuites || suiteRef === undefined) ? 'precoded' : suiteRef - } - - await github.rest.actions.createWorkflowDispatch({ - owner: 'rspack-contrib', - repo: 'rspack-ecosystem-ci', - workflow_id: 'ecosystem-ci-from-pr.yml', - ref: 'main', - inputs: { - prNumber: '' + prData.num, - branchName: prData.branchName, - repo: prData.repo, - suite: allSuites ? '-' : suite, - suiteRefType: normalizeSuiteRefType(suiteRefType), - suiteRef: normalizeSuiteRef(suiteRef), - } - }) diff --git a/.github/workflows/ecosystem-ci.yml b/.github/workflows/ecosystem-ci.yml index d219e897a89a..4d4d8aaa71a2 100644 --- a/.github/workflows/ecosystem-ci.yml +++ b/.github/workflows/ecosystem-ci.yml @@ -25,14 +25,14 @@ on: required: true type: string default: "-" -# push: -# branches: -# - main -# paths-ignore: -# - "**/*.md" -# - "website/**" -# tags-ignore: -# - "**" + push: + branches: + - main + paths-ignore: + - "**/*.md" + - "website/**" + tags-ignore: + - "**" jobs: get-runner-labels: