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

add liners monitoring #95

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
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
31 changes: 29 additions & 2 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
env:
RUNNER_LABEL: ${{ needs.prologue.outputs.linux_runner_label }}
env:
RUNNER_LABEL: ${{ needs.prologue.outputs.linux_runner_label }}
- 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