Improve deploy-related scripts #3545
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: AIN-blockchain CI/CD | |
on: | |
push: | |
branches: | |
- 'develop' | |
- 'release/*' | |
- 'master' | |
pull_request: | |
branches: | |
- 'develop' | |
- 'release/*' | |
- 'master' | |
types: [opened, synchronize, reopened, closed] | |
jobs: | |
build_and_unit_test: | |
if: ${{ github.event_name == 'pull_request' && github.event.action == 'opened' }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
node-version: [ '18.x' ] | |
runs-on: ${{ matrix.os }} | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v2 | |
# Setup node environment for testing | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: ${{ matrix.node-version }} | |
registry-url: 'https://registry.npmjs.org' | |
- name: node-gyp install | |
run: yarn global add node-gyp | |
- name: yarn install | |
run: yarn install | |
- name: run unittest | |
run: yarn run test_unit | |
performance_test: | |
if: github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged && github.event.pull_request.base.ref == 'develop' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: google-github-actions/setup-gcloud@v0 | |
with: | |
service_account_key: ${{ secrets.PERF_TEST_PIPELINE_GCP_SA_KEY }} | |
project_id: ${{ secrets.PERF_TEST_PIPELINE_GCP_PROJECT_ID }} | |
- name: send test start message to gcp | |
run: |- | |
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 &" & | |
sleep 60 |