diff --git a/.github/workflows/chaos.yml b/.github/workflows/chaos.yml deleted file mode 100644 index 01a98712d..000000000 --- a/.github/workflows/chaos.yml +++ /dev/null @@ -1,109 +0,0 @@ -name: Chaos CI -on: - workflow_dispatch: - inputs: - dispatch: - type: string - description: "Dispatch contains pr context that want to trigger chaos test" - required: true - -jobs: - build: - if: contains(github.event_name, 'workflow_dispatch') - runs-on: self-hosted - environment: chaos - outputs: - output-sha: ${{ steps.escape_multiple_lines_test_inputs.outputs.sha }} - steps: - - name: Generate axon-bot token - if: contains(github.event_name, 'workflow_dispatch') && - github.repository_owner == 'axonweb3' && github.event.inputs.dispatch != 'regression' - id: generate_axon_bot_token - uses: wow-actions/use-app-token@v2 - with: - app_id: ${{ secrets.AXON_BOT_APP_ID }} - private_key: ${{ secrets.AXON_BOT_PRIVATE_KEY }} - - name: Event is dispatch - if: contains(github.event_name, 'workflow_dispatch') && - github.repository_owner == 'axonweb3' && github.event.inputs.dispatch != 'regression' - uses: actions/github-script@v7 - id: get_sha - with: - github-token: ${{ steps.generate_axon_bot_token.outputs.BOT_TOKEN }} - script: | - const dispatch = JSON.parse(`${{ github.event.inputs.dispatch }}`); - const pr = ( - await github.rest.pulls.get({ - owner: dispatch.repo.owner, - repo: dispatch.repo.repo, - pull_number: dispatch.issue.number, - }) - ).data.head; - github.rest.repos.createCommitStatus({ - state: 'pending', - owner: dispatch.repo.owner, - repo: dispatch.repo.repo, - context: '${{ github.workflow }}', - sha: pr.sha, - target_url: 'https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}' - }) - const ref= pr.ref; - const pr_number= dispatch.issue.number; - const sha= pr.sha; - return { ref,pr_number,sha} - - name: Escape multiple lines test inputs - if: contains(github.event_name, 'workflow_dispatch') && - github.repository_owner == 'axonweb3' && github.event.inputs.dispatch != 'regression' - id: escape_multiple_lines_test_inputs - run: | - ref=$(echo "${{ steps.get_sha.outputs.result }}" | awk -F ':' '{print $2}'| awk -F ',' '{print $1}') - pr_number=$(echo "${{ steps.get_sha.outputs.result }}" | awk -F ':' '{print $3}'| awk -F ',' '{print $1}') - sha=$(echo "${{ steps.get_sha.outputs.result }}" | awk -F ':' '{print $4}'| awk -F '}' '{print $1}') - echo "ref=$ref" >> $GITHUB_OUTPUT - echo "pr_number=$pr_number" >> $GITHUB_OUTPUT - echo "sha=$sha" >> $GITHUB_OUTPUT - - - name: Git checkout - uses: actions/checkout@v4 - with: - ref: ${{ steps.escape_multiple_lines_test_inputs.outputs.ref || 'main' }} - - - name: Build Axon - run: | - cd /home/ckb/axon-devops/axon-image/ - ansible-playbook build.yml --tags build -e axon_branch=${{ steps.escape_multiple_lines_test_inputs.outputs.ref }} -e pr_number=${{ steps.escape_multiple_lines_test_inputs.outputs.pr_number }} - - - name: Run chaos - run: | - cd /home/ckb/axon-devops/axon-chaos/axon-chaos-integration - yarn install - node index.js ${{ secrets.CHAOS_URL }} - - finally: - name: Finally - needs: [ build ] - if: always() && contains(github.event_name, 'workflow_dispatch') && - github.event.inputs.dispatch != 'regression' && github.repository_owner == 'axonweb3' - runs-on: ubuntu-latest - steps: - - name: Generate axon-bot token - id: generate_axon_bot_token - uses: wow-actions/use-app-token@v2 - with: - app_id: ${{ secrets.AXON_BOT_APP_ID }} - private_key: ${{ secrets.AXON_BOT_PRIVATE_KEY }} - - if: contains(join(needs.*.result, ';'), 'failure') || contains(join(needs.*.result, ';'), 'cancelled') - run: exit 1 - - uses: actions/github-script@v7 - if: ${{ always() }} - with: - github-token: ${{ steps.generate_axon_bot_token.outputs.BOT_TOKEN }} - script: | - github.rest.repos.createCommitStatus({ - state: '${{ job.status }}', - owner: context.repo.owner, - repo: context.repo.repo, - context: '${{ github.workflow }}', - sha: '${{ needs.build.outputs.output-sha }}', - target_url: 'https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}' - }) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f0151cd2e..1f18b1399 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -138,22 +138,3 @@ jobs: asset_name: axon_${{ needs.version.outputs.tag }}_${{ matrix.REL_PKG }} asset_path: ${{ github.workspace }}/axon_${{ needs.version.outputs.tag }}_${{ matrix.REL_PKG }} asset_content_type: application/octet-stream - - trigger-build-docker-image: - runs-on: ubuntu-22.04 - needs: - - version - steps: - - uses: actions/checkout@v4 - - name: Generate axon-bot token - id: generate_axon_bot_token - uses: wow-actions/use-app-token@v2 - with: - app_id: ${{ secrets.AXON_BOT_APP_ID }} - private_key: ${{ secrets.AXON_BOT_PRIVATE_KEY }} - - name: Invoke build docker image with inputs - uses: aurelien-baudet/workflow-dispatch@v2 - with: - workflow: Build docker image - token: ${{ secrets.GITHUB_TOKEN }} - inputs: '{ "dispatch": "${{ needs.version.outputs.tag }}" }'