Skip to content

Commit

Permalink
add ci monitoring
Browse files Browse the repository at this point in the history
  • Loading branch information
liya2017 authored and liya2017 committed Jan 25, 2022
1 parent 61fab51 commit 7eddd6c
Show file tree
Hide file tree
Showing 15 changed files with 433 additions and 4 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/ci_benchmarks_macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,42 @@ jobs:
steps:
- uses: actions/checkout@v2
- run: |
echo "START_TIME=$(date +%Y-%m-%d' '%H:%M:%S)" >> $GITHUB_ENV
echo "CKB_COMMIT_ID=$(git describe --dirty --always --match _EXCLUDE__ --abbrev=7)" >> $GITHUB_ENV
echo "CKB_COMMIT_TIME=$(git log -1 --date=iso "--pretty=format:%cd" | cut -d ' ' -f 1,2)" >> $GITHUB_ENV
if [[ ${{ needs.prologue.outputs.os_skip }} == run ]] && [[ ${{ needs.prologue.outputs.job_skip }} == run ]];then
devtools/ci/ci_main.sh
else
echo "skip job"
exit 0
fi
shell: bash
- name: Set test state when success
if: ${{ success() }}
run: |
echo "GITHUB_RUN_STATE=0" >> $GITHUB_ENV
shell: bash
- name: Set test state when test failed.
if: ${{ failure() }}
run: |
echo "GITHUB_RUN_STATE=1" >> $GITHUB_ENV
shell: bash
- name: insert data to DB
# if: ${{ always() && github.repository_owner == 'nervosnetwork'}}
if: ${{ always() }}
run: |
if [[ ! -z "${{ env.PGHOST }}" ]];then
end_time=$(date +%Y-%m-%d' '%H:%M:%S)
echo $end_time
psql -c "INSERT INTO ci (github_run_name,github_run_id,github_run_state,start_time,end_time,github_branch,github_trigger_event,github_repo_owner,github_pr_number,github_commit_id,github_commit_time,github_action_run_os,github_run_link) \
VALUES ('$GITHUB_WORKFLOW','$GITHUB_RUN_ID','${{ env.GITHUB_RUN_STATE }}','${{ env.START_TIME }}','$end_time','${{ github.ref_name }}','${{github.event_name }}','${{ github.repository_owner }}','${{github.event.number}}','${{ env.CKB_COMMIT_ID }}','${{ env.CKB_COMMIT_TIME}}','ubuntu','https://github.com/${{ github.repository }}actions/runs/${{ github.run_id }}');"
fi
shell: bash
env:
PGHOST: ${{ secrets.PGHOST }}
PGPORT: ${{ secrets.PGPORT }}
PGUSER: ${{ secrets.PGUSER }}
PGPASSWORD: ${{ secrets.PGPASSWORD }}
PGDATABASE: ckbtest
env:
RUNNER_LABEL: ${{ needs.prologue.outputs.runner_label }}
32 changes: 31 additions & 1 deletion .github/workflows/ci_benchmarks_ubuntu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,42 @@ jobs:
steps:
- uses: actions/checkout@v2
- run: |
echo "START_TIME=$(date +%Y-%m-%d' '%H:%M:%S.%6N)" >> $GITHUB_ENV
echo "CKB_COMMIT_ID=$(git describe --dirty --always --match _EXCLUDE__ --abbrev=7)" >> $GITHUB_ENV
echo "CKB_COMMIT_TIME=$(git log -1 --date=iso "--pretty=format:%cd" | cut -d ' ' -f 1,2)" >> $GITHUB_ENV
if [[ ${{ needs.prologue.outputs.os_skip }} == run ]] && [[ ${{ needs.prologue.outputs.job_skip }} == run ]];then
devtools/ci/ci_main.sh
else
echo "skip job"
exit 0
fi
shell: bash
- name: Set test state when success
if: ${{ success() }}
run: |
echo "GITHUB_RUN_STATE=0" >> $GITHUB_ENV
shell: bash
- name: Set test state when test failed.
if: ${{ failure() }}
run: |
echo "GITHUB_RUN_STATE=1" >> $GITHUB_ENV
shell: bash
- name: insert data to DB
# if: ${{ always() && github.repository_owner == 'nervosnetwork'}}
if: ${{ always() }}
run: |
if [[ ! -z "${{ env.PGHOST }}" ]];then
end_time=$(date +%Y-%m-%d' '%H:%M:%S.%6N)
echo $end_time
psql -c "INSERT INTO ci (github_run_name,github_run_id,github_run_state,start_time,end_time,github_branch,github_trigger_event,github_repo_owner,github_pr_number,github_commit_id,github_commit_time,github_action_run_os,github_run_link) \
VALUES ('$GITHUB_WORKFLOW','$GITHUB_RUN_ID','${{ env.GITHUB_RUN_STATE }}','${{ env.START_TIME }}','$end_time','${{ github.ref_name }}','${{github.event_name }}','${{ github.repository_owner }}','${{github.event.number}}','${{ env.CKB_COMMIT_ID }}','${{ env.CKB_COMMIT_TIME}}','ubuntu','https://github.com/${{ github.repository }}actions/runs/${{ github.run_id }}');"
fi
shell: bash
env:
PGHOST: ${{ secrets.PGHOST }}
PGPORT: ${{ secrets.PGPORT }}
PGUSER: ${{ secrets.PGUSER }}
PGPASSWORD: ${{ secrets.PGPASSWORD }}
PGDATABASE: ckbtest
env:
RUNNER_LABEL: ${{ needs.prologue.outputs.linux_runner_label }}
RUNNER_LABEL: ${{ needs.prologue.outputs.windows_runner_label }}
35 changes: 35 additions & 0 deletions .github/workflows/ci_benchmarks_windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,51 @@ jobs:
iex (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')
echo "$env:USERPROFILE\scoop\shims" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "${{ github.workspace }}\devtools\windows" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
scoop install https://raw.githubusercontent.com/ScoopInstaller/Versions/master/bucket/7zip-zstd.json
scoop install git
scoop bucket add extras
scoop install llvm yasm
$pgService = Get-Service -Name postgresql*
Set-Service -InputObject $pgService -Status running -StartupType automatic
Start-Process -FilePath "$env:PGBIN\pg_isready" -Wait -PassThru
- run: |
echo "START_TIME=$(date +%Y-%m-%d' '%H:%M:%S.%6N)" >> $GITHUB_ENV
echo "CKB_COMMIT_ID=$(git describe --dirty --always --match _EXCLUDE__ --abbrev=7)" >> $GITHUB_ENV
echo "CKB_COMMIT_TIME=$(git log -1 --date=iso "--pretty=format:%cd" | cut -d ' ' -f 1,2)" >> $GITHUB_ENV
if [[ ${{ needs.prologue.outputs.os_skip }} == run ]] && [[ ${{ needs.prologue.outputs.job_skip }} == run ]];then
devtools/ci/ci_main.sh
else
echo "skip job"
exit 0
fi
shell: bash
- name: Set test state when success
if: ${{ success() }}
run: |
echo "GITHUB_RUN_STATE=0" >> $GITHUB_ENV
shell: bash
- name: Set test state when test failed.
if: ${{ failure() }}
run: |
echo "GITHUB_RUN_STATE=1" >> $GITHUB_ENV
shell: bash
- name: insert data to DB
# if: ${{ always() && github.repository_owner == 'nervosnetwork'}}
if: ${{ always() }}
run: |
if [[ ! -z "${{ env.PGHOST }}" ]];then
end_time=$(date +%Y-%m-%d' '%H:%M:%S.%6N)
echo $end_time
echo $PGBIN
"$PGBIN\psql" -c "INSERT INTO ci (github_run_name,github_run_id,github_run_state,start_time,end_time,github_branch,github_trigger_event,github_repo_owner,github_pr_number,github_commit_id,github_commit_time,github_action_run_os,github_run_link) \
VALUES ('$GITHUB_WORKFLOW','$GITHUB_RUN_ID','${{ env.GITHUB_RUN_STATE }}','${{ env.START_TIME }}','$end_time','${{ github.ref_name }}','${{github.event_name }}','${{ github.repository_owner }}','${{github.event.number}}','${{ env.CKB_COMMIT_ID }}','${{ env.CKB_COMMIT_TIME}}','ubuntu','https://github.com/${{ github.repository }}actions/runs/${{ github.run_id }}');"
fi
shell: bash
env:
PGHOST: ${{ secrets.PGHOST }}
PGPORT: ${{ secrets.PGPORT }}
PGUSER: ${{ secrets.PGUSER }}
PGPASSWORD: ${{ secrets.PGPASSWORD }}
PGDATABASE: ckbtest
env:
RUNNER_LABEL: ${{ needs.prologue.outputs.windows_runner_label }}
3 changes: 3 additions & 0 deletions .github/workflows/ci_cargo_deny_ubuntu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ jobs:
- uses: actions/checkout@v2
- name: ci_cargo_deny_ubuntu
run: |
echo "START_TIME=$(date +%Y-%m-%d' '%H:%M:%S.%6N)" >> $GITHUB_ENV
echo "CKB_COMMIT_ID=$(git describe --dirty --always --match _EXCLUDE__ --abbrev=7)" >> $GITHUB_ENV
echo "CKB_COMMIT_TIME=$(git log -1 --date=iso "--pretty=format:%cd" | cut -d ' ' -f 1,2)" >> $GITHUB_ENV
if [[ ${{ needs.prologue.outputs.os_skip }} == run ]] && [[ ${{ needs.prologue.outputs.job_skip }} == run ]];then
devtools/ci/ci_main.sh
else
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/ci_integration_tests_macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,43 @@ jobs:
steps:
- uses: actions/checkout@v2
- run: |
echo "START_TIME=$(date +%Y-%m-%d' '%H:%M:%S)" >> $GITHUB_ENV
echo "CKB_COMMIT_ID=$(git describe --dirty --always --match _EXCLUDE__ --abbrev=7)" >> $GITHUB_ENV
echo "CKB_COMMIT_TIME=$(git log -1 --date=iso "--pretty=format:%cd" | cut -d ' ' -f 1,2)" >> $GITHUB_ENV
if [[ ${{ needs.prologue.outputs.os_skip }} == run ]] && [[ ${{ needs.prologue.outputs.job_skip }} == run ]];then
devtools/ci/ci_main.sh
else
echo "skip job"
exit 0
fi
shell: bash
- name: Set test state when success
if: ${{ success() }}
run: |
echo "GITHUB_RUN_STATE=0" >> $GITHUB_ENV
shell: bash
- name: Set test state when test failed.
if: ${{ failure() }}
run: |
echo "GITHUB_RUN_STATE=1" >> $GITHUB_ENV
shell: bash
- name: insert data to DB
# if: ${{ always() && github.repository_owner == 'nervosnetwork'}}
if: ${{ always() }}
run: |
if [[ ! -z "${{ env.PGHOST }}" ]];then
end_time=$(date +%Y-%m-%d' '%H:%M:%S)
echo $end_time
psql -c "INSERT INTO ci (github_run_name,github_run_id,github_run_state,start_time,end_time,github_branch,github_trigger_event,github_repo_owner,github_pr_number,github_commit_id,github_commit_time,github_action_run_os,github_run_link) \
VALUES ('$GITHUB_WORKFLOW','$GITHUB_RUN_ID','${{ env.GITHUB_RUN_STATE }}','${{ env.START_TIME }}','$end_time','${{ github.ref_name }}','${{github.event_name }}','${{ github.repository_owner }}','${{github.event.number}}','${{ env.CKB_COMMIT_ID }}','${{ env.CKB_COMMIT_TIME}}','ubuntu','https://github.com/${{ github.repository }}actions/runs/${{ github.run_id }}');"
fi
shell: bash
env:
PGHOST: ${{ secrets.PGHOST }}
PGPORT: ${{ secrets.PGPORT }}
PGUSER: ${{ secrets.PGUSER }}
PGPASSWORD: ${{ secrets.PGPASSWORD }}
PGDATABASE: ckbtest
- name: upload log files
if: always()
uses: actions/upload-artifact@v2
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/ci_integration_tests_ubuntu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,43 @@ jobs:
steps:
- uses: actions/checkout@v2
- run: |
echo "START_TIME=$(date +%Y-%m-%d' '%H:%M:%S.%6N)" >> $GITHUB_ENV
echo "CKB_COMMIT_ID=$(git describe --dirty --always --match _EXCLUDE__ --abbrev=7)" >> $GITHUB_ENV
echo "CKB_COMMIT_TIME=$(git log -1 --date=iso "--pretty=format:%cd" | cut -d ' ' -f 1,2)" >> $GITHUB_ENV
if [[ ${{ needs.prologue.outputs.os_skip }} == run ]] && [[ ${{ needs.prologue.outputs.job_skip }} == run ]];then
devtools/ci/ci_main.sh
else
echo "skip job"
exit 0
fi
shell: bash
- name: Set test state when success
if: ${{ success() }}
run: |
echo "GITHUB_RUN_STATE=0" >> $GITHUB_ENV
shell: bash
- name: Set test state when test failed.
if: ${{ failure() }}
run: |
echo "GITHUB_RUN_STATE=1" >> $GITHUB_ENV
shell: bash
- name: insert data to DB
# if: ${{ always() && github.repository_owner == 'nervosnetwork'}}
if: ${{ always() }}
run: |
if [[ ! -z "${{ env.PGHOST }}" ]];then
end_time=$(date +%Y-%m-%d' '%H:%M:%S.%6N)
echo $end_time
psql -c "INSERT INTO ci (github_run_name,github_run_id,github_run_state,start_time,end_time,github_branch,github_trigger_event,github_repo_owner,github_pr_number,github_commit_id,github_commit_time,github_action_run_os,github_run_link) \
VALUES ('$GITHUB_WORKFLOW','$GITHUB_RUN_ID','${{ env.GITHUB_RUN_STATE }}','${{ env.START_TIME }}','$end_time','${{ github.ref_name }}','${{github.event_name }}','${{ github.repository_owner }}','${{github.event.number}}','${{ env.CKB_COMMIT_ID }}','${{ env.CKB_COMMIT_TIME}}','ubuntu','https://github.com/${{ github.repository }}actions/runs/${{ github.run_id }}');"
fi
shell: bash
env:
PGHOST: ${{ secrets.PGHOST }}
PGPORT: ${{ secrets.PGPORT }}
PGUSER: ${{ secrets.PGUSER }}
PGPASSWORD: ${{ secrets.PGPASSWORD }}
PGDATABASE: ckbtest
- name: upload log files
if: always()
uses: actions/upload-artifact@v2
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/ci_integration_tests_windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,52 @@ jobs:
iex (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')
echo "$env:USERPROFILE\scoop\shims" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "${{ github.workspace }}\devtools\windows" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
scoop install https://raw.githubusercontent.com/ScoopInstaller/Versions/master/bucket/7zip-zstd.json
scoop install git
scoop bucket add extras
scoop install llvm yasm
$pgService = Get-Service -Name postgresql*
Set-Service -InputObject $pgService -Status running -StartupType automatic
Start-Process -FilePath "$env:PGBIN\pg_isready" -Wait -PassThru
- run: |
echo "START_TIME=$(date +%Y-%m-%d' '%H:%M:%S.%6N)" >> $GITHUB_ENV
echo "CKB_COMMIT_ID=$(git describe --dirty --always --match _EXCLUDE__ --abbrev=7)" >> $GITHUB_ENV
echo "CKB_COMMIT_TIME=$(git log -1 --date=iso "--pretty=format:%cd" | cut -d ' ' -f 1,2)" >> $GITHUB_ENV
if [[ ${{ needs.prologue.outputs.os_skip }} == run ]] && [[ ${{ needs.prologue.outputs.job_skip }} == run ]];then
devtools/ci/ci_main.sh
else
echo "skip job"
exit 0
fi
shell: bash
- name: Set test state when success
if: ${{ success() }}
run: |
echo "GITHUB_RUN_STATE=0" >> $GITHUB_ENV
shell: bash
- name: Set test state when test failed.
if: ${{ failure() }}
run: |
echo "GITHUB_RUN_STATE=1" >> $GITHUB_ENV
shell: bash
- name: insert data to DB
# if: ${{ always() && github.repository_owner == 'nervosnetwork'}}
if: ${{ always() }}
run: |
if [[ ! -z "${{ env.PGHOST }}" ]];then
end_time=$(date +%Y-%m-%d' '%H:%M:%S.%6N)
echo $end_time
echo $PGBIN
"$PGBIN\psql" -c "INSERT INTO ci (github_run_name,github_run_id,github_run_state,start_time,end_time,github_branch,github_trigger_event,github_repo_owner,github_pr_number,github_commit_id,github_commit_time,github_action_run_os,github_run_link) \
VALUES ('$GITHUB_WORKFLOW','$GITHUB_RUN_ID','${{ env.GITHUB_RUN_STATE }}','${{ env.START_TIME }}','$end_time','${{ github.ref_name }}','${{github.event_name }}','${{ github.repository_owner }}','${{github.event.number}}','${{ env.CKB_COMMIT_ID }}','${{ env.CKB_COMMIT_TIME}}','ubuntu','https://github.com/${{ github.repository }}actions/runs/${{ github.run_id }}');"
fi
shell: bash
env:
PGHOST: ${{ secrets.PGHOST }}
PGPORT: ${{ secrets.PGPORT }}
PGUSER: ${{ secrets.PGUSER }}
PGPASSWORD: ${{ secrets.PGPASSWORD }}
PGDATABASE: ckbtest
- name: upload log files
if: always()
uses: actions/upload-artifact@v2
Expand Down
28 changes: 27 additions & 1 deletion .github/workflows/ci_linters_macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,39 @@ jobs:
steps:
- uses: actions/checkout@v2
- run: |
brew install grep gnu-sed
echo "START_TIME=$(date +%Y-%m-%d' '%H:%M:%S)" >> $GITHUB_ENV
echo "CKB_COMMIT_ID=$(git describe --dirty --always --match _EXCLUDE__ --abbrev=7)" >> $GITHUB_ENV
echo "CKB_COMMIT_TIME=$(git log -1 --date=iso "--pretty=format:%cd" | cut -d ' ' -f 1,2)" >> $GITHUB_ENV
if [[ ${{ needs.prologue.outputs.os_skip }} == run ]] && [[ ${{ needs.prologue.outputs.job_skip }} == run ]];then
devtools/ci/ci_main.sh
else
echo "skip job"
exit 0
fi
shell: bash
- name: Set test state when success
if: ${{ success() }}
run: |
echo "GITHUB_RUN_STATE=0" >> $GITHUB_ENV
- name: Set test state when test failed.
if: ${{ failure() }}
run: |
echo "GITHUB_RUN_STATE=1" >> $GITHUB_ENV
- name: insert data to DB
# if: ${{ always() && github.repository_owner == 'nervosnetwork'}}
if: ${{ always() }}
run: |
if [[ ! -z "${{ env.PGHOST }}" ]];then
end_time=$(date +%Y-%m-%d' '%H:%M:%S)
echo $end_time
psql -c "INSERT INTO ci (github_run_name,github_run_id,github_run_state,start_time,end_time,github_branch,github_trigger_event,github_repo_owner,github_pr_number,github_commit_id,github_commit_time,github_action_run_os,github_run_link) \
VALUES ('$GITHUB_WORKFLOW','$GITHUB_RUN_ID','${{ env.GITHUB_RUN_STATE }}','${{ env.START_TIME }}','$end_time','${{ github.ref_name }}','${{github.event_name }}','${{ github.repository_owner }}','${{github.event.number}}','${{ env.CKB_COMMIT_ID }}','${{ env.CKB_COMMIT_TIME}}','ubuntu','https://github.com/${{ github.repository }}actions/runs/${{ github.run_id }}');"
fi
env:
PGHOST: ${{ secrets.PGHOST }}
PGPORT: ${{ secrets.PGPORT }}
PGUSER: ${{ secrets.PGUSER }}
PGPASSWORD: ${{ secrets.PGPASSWORD }}
PGDATABASE: ckbtest
env:
RUNNER_LABEL: ${{ needs.prologue.outputs.runner_label }}
27 changes: 27 additions & 0 deletions .github/workflows/ci_linters_ubuntu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,39 @@ jobs:
steps:
- uses: actions/checkout@v2
- run: |
echo "START_TIME=$(date +%Y-%m-%d' '%H:%M:%S.%6N)" >> $GITHUB_ENV
echo "CKB_COMMIT_ID=$(git describe --dirty --always --match _EXCLUDE__ --abbrev=7)" >> $GITHUB_ENV
echo "CKB_COMMIT_TIME=$(git log -1 --date=iso "--pretty=format:%cd" | cut -d ' ' -f 1,2)" >> $GITHUB_ENV
if [[ ${{ needs.prologue.outputs.os_skip }} == run ]] && [[ ${{ needs.prologue.outputs.job_skip }} == run ]];then
devtools/ci/ci_main.sh
else
echo "skip job"
exit 0
fi
shell: bash
- name: Set test state when success
if: ${{ success() }}
run: |
echo "GITHUB_RUN_STATE=0" >> $GITHUB_ENV
- name: Set test state when test failed.
if: ${{ failure() }}
run: |
echo "GITHUB_RUN_STATE=1" >> $GITHUB_ENV
- name: insert data to DB
# if: ${{ always() && github.repository_owner == 'nervosnetwork'}}
if: ${{ always() }}
run: |
if [[ ! -z "${{ env.PGHOST }}" ]];then
end_time=$(date +%Y-%m-%d' '%H:%M:%S.%6N)
echo $end_time
psql -c "INSERT INTO ci (github_run_name,github_run_id,github_run_state,start_time,end_time,github_branch,github_trigger_event,github_repo_owner,github_pr_number,github_commit_id,github_commit_time,github_action_run_os,github_run_link) \
VALUES ('$GITHUB_WORKFLOW','$GITHUB_RUN_ID','${{ env.GITHUB_RUN_STATE }}','${{ env.START_TIME }}','$end_time','${{ github.ref_name }}','${{github.event_name }}','${{ github.repository_owner }}','${{github.event.number}}','${{ env.CKB_COMMIT_ID }}','${{ env.CKB_COMMIT_TIME}}','ubuntu','https://github.com/${{ github.repository }}actions/runs/${{ github.run_id }}');"
fi
env:
PGHOST: ${{ secrets.PGHOST }}
PGPORT: ${{ secrets.PGPORT }}
PGUSER: ${{ secrets.PGUSER }}
PGPASSWORD: ${{ secrets.PGPASSWORD }}
PGDATABASE: ckbtest
env:
RUNNER_LABEL: ${{ needs.prologue.outputs.linux_runner_label }}
Loading

0 comments on commit 7eddd6c

Please sign in to comment.