Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: refactor web_compatible workflow #1392

Merged
merged 6 commits into from
Sep 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 14 additions & 24 deletions .github/workflows/entry_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ on:

jobs:
run-ci:
name: from-comments
name: run-ci-from-pr-comment
# PullRequestEvent: https://docs.github.com/en/rest/overview/github-event-types?apiVersion=2022-11-28#pullrequestevent
if: github.event.issue.pull_request && startsWith(github.event.comment.body, '/run-ci')
runs-on: ubuntu-22.04
# When the permissions key is used, all unspecified permissions are set to no access, with the exception of the metadata scope, which always gets read access.
Expand Down Expand Up @@ -53,47 +54,35 @@ jobs:
repo: context.repo.repo,
pull_number: context.issue.number,
});

let check_list=`
\### CI test list:
`;
// check Chaos CI exist or not
const chaos_match = pr.data.body.includes("[x] Chaos CI");
if (chaos_match) {
const resp = await github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: "chaos.yml",
ref: "main",
inputs: {
dispatch: jsonDispatch,
}
});
core.info(`${JSON.stringify(resp, null, 2)}`);
check_list=`${check_list}\n - Chaos CI`;
}

// check Coverage Test exist or not
const coverage_match = pr.data.body.includes("[x] Coverage Test");
if (coverage_match) {
const resp = await github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: "coverage.yml",
ref: "main",
ref: `main`,
inputs: {
dispatch: jsonDispatch,
}
});
core.info(`${JSON.stringify(resp, null, 2)}`);
check_list=`${check_list}\n - Coverage Test`;
}

// check E2E Tests exist or not
const e2e_match = pr.data.body.includes("[x] E2E Tests");
if (e2e_match) {
const resp = await github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: "e2e_test.yml",
ref: "main",
ref: `main`,
inputs: {
dispatch: jsonDispatch,
}
Expand All @@ -108,7 +97,7 @@ jobs:
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: "openzeppelin_test_1_5_and_12_15.yml",
ref: "main",
ref: `main`,
inputs: {
dispatch: jsonDispatch,
}
Expand All @@ -123,7 +112,7 @@ jobs:
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: "openzeppelin_test_6_10.yml",
ref: "main",
ref: `main`,
inputs: {
dispatch: jsonDispatch,
}
Expand All @@ -138,7 +127,7 @@ jobs:
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: "openzeppelin_test_11.yml",
ref: "main",
ref: `main`,
inputs: {
dispatch: jsonDispatch,
}
Expand All @@ -153,7 +142,7 @@ jobs:
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: "openzeppelin_test_16_19.yml",
ref: "main",
ref: `main`,
inputs: {
dispatch: jsonDispatch,
}
Expand All @@ -168,7 +157,7 @@ jobs:
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: "v3_core_test.yml",
ref: "main",
ref: `main`,
inputs: {
dispatch: jsonDispatch,
}
Expand All @@ -183,7 +172,7 @@ jobs:
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: "web3_compatible.yml",
ref: "main",
ref: `main`,
inputs: {
dispatch: jsonDispatch,
}
Expand All @@ -203,6 +192,7 @@ jobs:
# https://docs.github.com/en/rest/issues/comments?apiVersion=2022-11-28#create-an-issue-comment
# The `pull-requests: write` permission is required in the step.
- name: Post a coment about component information to PR
if: contains('admin write', fromJson(steps.user_permission.outputs.data).permission)
id: post_workflow_run_comment
uses: actions/github-script@v6
with:
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/regression_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:

jobs:
invoke-fmt-test:
if: github.repository_owner == 'axonweb3'
runs-on: ubuntu-latest
steps:
- name: Invoke fmt test
Expand All @@ -15,9 +16,9 @@ jobs:
with:
workflow: Code Format
token: ${{ secrets.GITHUB_TOKEN }}
inputs: '{ "dispatch": "regression" }'

invoke-E2E-test:
if: github.repository_owner == 'axonweb3'
runs-on: ubuntu-latest
steps:
- name: Invoke fmt test
Expand All @@ -29,6 +30,7 @@ jobs:
inputs: '{ "dispatch": "regression" }'

invoke-v3-core-test:
if: github.repository_owner == 'axonweb3'
runs-on: ubuntu-latest
steps:
- name: Invoke v3 core test
Expand All @@ -41,6 +43,7 @@ jobs:
inputs: '{ "dispatch": "regression" }'

invoke-web3-compatible-test:
if: github.repository_owner == 'axonweb3'
runs-on: ubuntu-latest
steps:
- name: Invoke web3 compatible test
Expand All @@ -53,6 +56,7 @@ jobs:
inputs: '{ "dispatch": "regression" }'

invoke-openzeppelin-test-1-5-and-12-15-test:
if: github.repository_owner == 'axonweb3'
runs-on: ubuntu-latest
steps:
- name: Invoke OCT 1-5 And 12-15 test
Expand All @@ -65,6 +69,7 @@ jobs:
inputs: '{ "dispatch": "regression" }'

invoke-OCT-6-10-test:
if: github.repository_owner == 'axonweb3'
runs-on: ubuntu-latest
steps:
- name: Invoke OCT 1-5 And 12-15 test
Expand All @@ -77,6 +82,7 @@ jobs:
inputs: '{ "dispatch": "regression" }'

invoke-OCT-11-test:
if: github.repository_owner == 'axonweb3'
runs-on: ubuntu-latest
steps:
- name: Invoke OCT 11 test
Expand All @@ -89,6 +95,7 @@ jobs:
inputs: '{ "dispatch": "regression" }'

invoke-OCT-16-19-test:
if: github.repository_owner == 'axonweb3'
runs-on: ubuntu-latest
steps:
- name: Invoke OCT 16-19 test
Expand All @@ -101,6 +108,7 @@ jobs:
inputs: '{ "dispatch": "regression" }'

invoke-chaos-test:
if: github.repository_owner == 'axonweb3'
runs-on: ubuntu-latest
steps:
- name: Invoke OCT 16-19 test
Expand All @@ -115,7 +123,7 @@ jobs:
output-result:
runs-on: ubuntu-latest
needs: [invoke-fmt-test,invoke-E2E-test,invoke-v3-core-test,invoke-web3-compatible-test,invoke-openzeppelin-test-1-5-and-12-15-test,invoke-OCT-6-10-test,invoke-OCT-11-test,invoke-OCT-16-19-test,invoke-chaos-test]
if: always()
if: github.repository_owner == 'axonweb3' && always()
steps:
- name: send message
uses: nobrayner/discord-webhook@v1
Expand Down
Loading