-
Notifications
You must be signed in to change notification settings - Fork 58
108 lines (105 loc) · 3.32 KB
/
pipeline.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: Deploy image
on:
pull_request:
types: [opened, reopened, synchronize, labeled, unlabeled, ready_for_review]
repository_dispatch:
push:
branches:
- master
- develop
- '[vt][0-9].[0-9]+.[0-9x]+*'
tags:
- "*"
env:
DHUBU: ${{secrets.DHUBU}}
DHUBP: ${{secrets.DHUBP}}
IMAGE_NAME: ${{vars.IMAGE_NAME}}
PROXY_ENDPOINT: ${{vars.PROXY_ENDPOINT}}
RUN_LINK_REPO: ${{vars.RUN_LINK_REPO}}
BUILD_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-neon-evm:
runs-on: neon-evm-1
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: build docker image
run: |
python3 ./.github/workflows/deploy.py build_docker_image \
--github_sha=${GITHUB_SHA}
- name: publish image
run: |
python3 ./.github/workflows/deploy.py publish_image \
--github_sha=${GITHUB_SHA}
run-neon-evm-tests:
runs-on: test-runner
needs:
- build-neon-evm
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Run tests
run: |
python3 ./.github/workflows/deploy.py run_tests \
--github_sha=${GITHUB_SHA}
trigger-proxy-tests:
runs-on: trigger-runner
needs:
- build-neon-evm
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Trigger proxy build
run: |
python3 ./.github/workflows/deploy.py trigger_proxy_action \
--github_sha=${GITHUB_SHA} \
--head_ref_branch=${{ github.head_ref }} \
--base_ref_branch=${{ github.base_ref }} \
--github_ref=${{ github.ref }} \
--token=${{secrets.GHTOKEN }} \
--is_draft=${{github.event.pull_request.draft}} \
--labels='${{ toJson(github.event.pull_request.labels.*.name) }}' \
--pr_url="${{ github.api_url }}/repos/${{ github.repository }}/issues" \
--pr_number="${{ github.event.pull_request.number }}"
finalize-image:
runs-on: neon-evm-1
needs:
- trigger-proxy-tests
- run-neon-evm-tests
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Finalize image
run: |
python3 ./.github/workflows/deploy.py finalize_image \
--head_ref_branch=${{ github.head_ref }} \
--github_ref=${GITHUB_REF} \
--github_sha=${GITHUB_SHA}
- name: Check if it version branch
id: is_version_branch
run: |
if [[ "${{ github.ref }}" =~ "refs/heads/"[vt][0-9]+\.[0-9]+\.x ]]; then
echo "value=true"
echo "value=true" >> $GITHUB_OUTPUT
else
echo "value=false"
echo "value=false" >> $GITHUB_OUTPUT
fi
- name: Send notification to slack
if: |
failure() &&
(github.ref_name == 'develop' ||
github.ref_name == 'master' ||
steps.is_version_branch.outputs.value) ||
startsWith(github.ref , 'refs/tags/')
run: |
python3 ./.github/workflows/deploy.py send_notification \
--url=${{secrets.SLACK_EVM_CHANNEL_URL}} \
--build_url=${BUILD_URL}