1313 - ' master'
1414 types : [opened, synchronize, reopened, closed]
1515jobs :
16- build_and_test :
17- if : ${{ github.event_name == 'pull_request' && ( github.event.action == 'opened' || github.event.action == 'edited') }}
16+ build_and_unit_test :
17+ if : ${{ github.event_name == 'pull_request' && github.event.action == 'opened' }}
1818 strategy :
1919 matrix :
2020 os : [ubuntu-latest, macos-latest]
3232 run : yarn install
3333 - name : run unittest
3434 run : yarn run test_unit
35- # integration test only run when master merging
36- - name : run blockchain integration test
37- if : github.event.action == 'opened' && github.event.pull_request.base.ref == 'master'
38- run : yarn run test_integration_blockchain
39- - name : run consensus integration test
40- if : github.event.action == 'opened' && github.event.pull_request.base.ref == 'master'
41- run : yarn run test_integration_consensus
42- - name : run dapp integration test
43- if : github.event.action == 'opened' && github.event.pull_request.base.ref == 'master'
44- run : yarn run test_integration_dapp
45- - name : run node integration test
46- if : github.event.action == 'opened' && github.event.pull_request.base.ref == 'master'
47- run : yarn run test_integration_node
48- - name : run sharding integration test
49- if : github.event.action == 'opened' && github.event.pull_request.base.ref == 'master'
50- run : yarn run test_integration_sharding
51- check_protocol_version :
52- if : ${{ github.event_name == 'push' }}
53- runs-on : macos-latest
54- steps :
55- - uses : actions/checkout@v2
56- - name : test
57- if : github.event_name == 'push'
58- run : echo ${{github.event_name}}
59- - name : get current version
60- run : echo "VERSION=$(cat package.json | jq -r '.version')" >> $GITHUB_ENV
61- - name : get min/max versions
62- run : |
63- echo "MIN_VERSION=$(cat client/protocol_versions.json | jq -r --arg var "$VERSION" '.[$var].min')" >> $GITHUB_ENV
64- echo "MAX_VERSION=$(cat client/protocol_versions.json | jq -r --arg var "$VERSION" '.[$var].max')" >> $GITHUB_ENV
65- - name : send results
66- env :
67- SLACK_WEBHOOK_TOKEN : ${{ secrets.SLACK_WEBHOOK_TOKEN }}
68- run : |
69- curl -X POST https://hooks.slack.com/services/$SLACK_WEBHOOK_TOKEN \
70- -H "Content-Type: application/json" \
71- -d '{"username": "AIN-BLOCKCHAIN",
72- "channel": "blockchain-testnet-deploy",
73- "text": "New PR has just been merged(${{ github.ref }}, ${{ github.sha }}).\nCurrent version: '"$VERSION"', compatible with min('"$MIN_VERSION"'), max('"$MAX_VERSION"')",
74- "icon_emoji": ":gem:"}'
7535 performance_test :
7636 if : github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged && github.event.pull_request.base.ref == 'develop'
7737 runs-on : ubuntu-latest
8343 - name : send test start message to gcp
8444 run : |-
8545 gcloud compute ssh "${{ secrets.PERF_TEST_PIPELINE_GCE_INSTANCE }}" --zone "${{ secrets.PERF_TEST_PIPELINE_GCE_INSTANCE_ZONE }}" -- "cd ~/../workspace/testnet-performance-test-pipeline && nohup node start_performance_test.js ${{ secrets.PERF_TEST_PIPELINE_TEST_SEASON }} ${{ secrets.PERF_TEST_PIPELINE_TEST_BRANCH }} ${{ github.event.pull_request.head.ref }} >> test_log.txt 2>&1 &" &
86- sleep 60
87- check_deployment :
88- if : github.event.pull_request.base.ref == 'master'
89- runs-on : macos-latest
90- steps :
91- - uses : actions/checkout@v2
92- - uses : actions/setup-node@v2
93- with :
94- node-version : ' 16.x'
95- registry-url : ' https://registry.npmjs.org'
96- - name : setup key
97- env :
98- PRIV_KEY_FOR_DOWNLOAD : ${{ secrets.DEPLOYMENT_PRIV_KEY_FOR_DOWNLOAD }}
99- KNOWN_HOSTS : ${{ secrets.DEPLOYMENT_KNOWN_HOSTS }}
100- run : |
101- echo "$PRIV_KEY_FOR_DOWNLOAD" > ./tools/cicd/id_rsa
102- chmod 600 ./tools/cicd/id_rsa
103- echo $KNOWN_HOSTS >> ~/.ssh/known_hosts
104- - name : check apps
105- env :
106- ENV_ID : ${{ secrets.DEPLOYMENT_ENV_ID }}
107- CLIENT_EMAIL : ${{ secrets.DEPLOYMENT_CLIENT_EMAIL }}
108- PRIVATE_KEY : ${{ secrets.DEPLOYMENT_PRIVATE_KEY}}
109- GPT2 : ${{ secrets.DEPLOYMENT_GPT2 }}
110- INSIGHT : ${{ secrets.DEPLOYMENT_INSIGHT }}
111- FAUCET : ${{ secrets.DEPLOYMENT_FAUCET }}
112- PIPELINE : ${{ secrets.DEPLOYMENT_PIPELINE }}
113- DATA : ${{ secrets.DEPLOYMENT_DATA }}
114- run : |
115- yarn add dotenv google-spreadsheet semver
116- node tools/cicd/deployment.js
117- - name : send slack message
118- env :
119- SLACK_WEBHOOK_TOKEN : ${{ secrets.SLACK_WEBHOOK_TOKEN }}
120- run : |
121- curl -X POST https://hooks.slack.com/services/$SLACK_WEBHOOK_TOKEN \
122- -H "Content-Type: application/json" \
123- -d '{"username": "APP_VERSION_CHECK",
124- "channel": "blockchain-testnet-deploy",
125- "text": "New blockchain version has just been released. Please check compatibility of app versions below:\n ${{ secrets.DEPLOYMENT_SHEET_URL }}",
126- "icon_emoji": ":bomb:"}'
46+ sleep 60
0 commit comments