forked from eosnetworkfoundation/eos-evm-contract
-
Notifications
You must be signed in to change notification settings - Fork 0
174 lines (154 loc) · 5.37 KB
/
pr.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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
name: "Validate build and run tests"
on:
pull_request:
types:
- opened
- synchronize
- reopened
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
# start-runner:
# name: Start Runner
# runs-on: ubuntu-latest
# steps:
# - name: Get Token
# id: application_token
# uses: peter-murray/workflow-application-token-action@v2
# with:
# application_id: ${{ secrets.APPLICATION_ID }}
# application_private_key: ${{ secrets.APPLICATION_PRIVATE_KEY }}
# - name: Trigger start-runner job
# uses: convictional/[email protected]
# with:
# owner: ultraio
# repo: blockchain-manager
# github_token: ${{ steps.application_token.outputs.token }}
# workflow_file_name: start-runner.yml
# job-cleanup:
# needs: start-runner
# name: "Cleanup"
# timeout-minutes: 5
# runs-on: "self-hosted"
# steps:
# - name: "Cleanup Previous Run"
# run: |
# sudo rm -rf ./* || true
# sudo rm -rf ./.??* || true
# sudo rm -rf $GITHUB_WORKSPACE || true
# mkdir $GITHUB_WORKSPACE
build-contracts:
name: "Build contracts and run tests"
timeout-minutes: 10
runs-on: ubuntu-latest
container:
# This repository can be found / pushed to in: ultraio/eosio-docker-starter
image: quay.io/ultra.io/eosio-docker-starter:5.0.0
options: >-
--init
--cpus 2
permissions:
contents: 'read'
id-token: 'write'
steps:
- name: Get Token
id: application_token
uses: peter-murray/workflow-application-token-action@v2
with:
application_id: ${{ secrets.APPLICATION_ID }}
application_private_key: ${{ secrets.APPLICATION_PRIVATE_KEY }}
- name: "Set env vars"
run: |
echo "ULTRA_PATH=/__w/eos-evm-contract/eos-evm-contract/ultra/" >> $GITHUB_ENV
# Update dependencies
- name: 'Update dependencies'
run: |
apt-get update -y \
&& apt-get install tree clang jq xxd -y
- name: Checkout Repo
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: 'recursive'
# Download latest version of CDT from releases
- uses: robinraju/[email protected]
with:
repository: "ultraio/eosio.cdt"
latest: true
fileName: "*.deb"
out-file-path: "./ultra/cdt"
token: '${{ steps.application_token.outputs.token }}'
# Install EOSIO.CDT Debian Image
- name: Install EOSIO.CDT Debian Image
run: apt install ./ultra/cdt/*.deb -y
- name: Build EOS EVM Contract
run: .github/workflows/build-contract.sh
env:
DWITH_TEST_ACTIONS: true
# Clone eosio.contracts repository
- uses: actions/checkout@v3
name: 'Clone eosio.contracts'
with:
repository: 'ultraio/eosio.contracts'
token: '${{ steps.application_token.outputs.token }}'
path: './ultra/eosio.contracts'
submodules: 'recursive'
fetch-depth: 0
ref: 'master'
# Download latest `eosio.contracts` release
- uses: robinraju/[email protected]
with:
repository: "ultraio/eosio.contracts"
latest: true
fileName: "*.tar.gz"
out-file-path: "./ultra/eosio.contracts"
token: '${{ steps.application_token.outputs.token }}'
- name: Extract eosio.contracts.tar.gz
run: |
mkdir -p ./ultra/eosio.contracts/build
tar -xf ./ultra/eosio.contracts/eosio-contracts-*.tar.gz -C ./ultra/eosio.contracts/build
# Download latest eosio
- name: Download latest eosio
uses: dsaltares/fetch-gh-release-asset@master
with:
repo: 'ultraio/eosio'
regex: true
# match eosio-***.deb
# don't match eosio-***-ubuntu20.deb
file: eosio-.*\.deb(?<!ubuntu20\.deb)$
token: '${{ steps.application_token.outputs.token }}'
# Install EOSIO Debian Image
- name: Install EOSIO Debian Image
run: |
ls -l
dpkg -i ./eosio*.deb
- uses: actions/setup-node@v3
with:
node-version: 20
- name: "Extract branch name"
run: |
GIT_BRANCH=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}
echo "branch=$GIT_BRANCH" >> $GITHUB_OUTPUT
id: extract_branch
- name: "Clone Ultratest2 with main"
uses: actions/checkout@v3
with:
repository: "ultraio/ultratest2"
token: "${{ steps.application_token.outputs.token }}"
path: "./ultra/ultratest2"
fetch-depth: 0
ref: "main"
- name: "Check if ultratest2 has branch with the same name"
continue-on-error: true
run: cd ./ultra/ultratest2 && git checkout ${{ steps.extract_branch.outputs.branch }}
- name: Install ultratest2
working-directory: ./ultra/ultratest2
run: |
npm install
npm link --force
- name: Run eosio.contracts ultratests2
if: always() && !cancelled()
working-directory: ./ultratests
shell: bash
run: ultratest2 --contracts-dir-path=$ULTRA_PATH/eosio.contracts/build/contracts