-
Notifications
You must be signed in to change notification settings - Fork 18
150 lines (148 loc) · 5.29 KB
/
ubuntu-2004.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
name: Ubuntu 22.04
on:
push:
branches:
- main
- "release/*"
pull_request:
types: [assigned, opened, synchronize, reopened, labeled]
workflow_dispatch:
inputs:
override-leap-dev:
description: Override leap-dev target
type: string
override-leap-dev-prerelease:
type: choice
description: Override leap-dev prelease
options:
- default
- true
- false
override-cdt:
description: 'Override cdt target'
type: string
override-cdt-prerelease:
type: choice
description: Override cdt prelease
options:
- default
- true
- false
defaults:
run:
shell: bash
jobs:
ubuntu-2204-build:
name: Ubuntu 22.04 | Build
runs-on: ubuntu-22.04
steps:
- name: Setup leap-dev & cdt versions
id: versions
env:
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
run: |
DEFAULTS_JSON=$(curl -sSfL $(gh api https://api.github.com/repos/${{github.repository}}/contents/.cicd/defaults.json?ref=${{github.sha}} --jq .download_url))
echo leap-dev-target=$(echo "$DEFAULTS_JSON" | jq -r '."leap-dev".target') >> $GITHUB_OUTPUT
echo leap-dev-prerelease=$(echo "$DEFAULTS_JSON" | jq -r '."leap-dev".prerelease') >> $GITHUB_OUTPUT
echo cdt-target=$(echo "$DEFAULTS_JSON" | jq -r '.cdt.target') >> $GITHUB_OUTPUT
echo cdt-prerelease=$(echo "$DEFAULTS_JSON" | jq -r '.cdt.prerelease') >> $GITHUB_OUTPUT
if [[ "${{inputs.override-leap-dev}}" != "" ]]; then
echo leap-dev-target=${{inputs.override-leap-dev}} >> $GITHUB_OUTPUT
fi
if [[ "${{inputs.override-leap-dev-prerelease}}" == +(true|false) ]]; then
echo leap-dev-prerelease=${{inputs.override-leap-dev-prerelease}} >> $GITHUB_OUTPUT
fi
if [[ "${{inputs.override-cdt}}" != "" ]]; then
echo cdt-target=${{inputs.override-cdt}} >> $GITHUB_OUTPUT
fi
if [[ "${{inputs.override-cdt-prerelease}}" == +(true|false) ]]; then
echo cdt-prerelease=${{inputs.override-cdt-prerelease}} >> $GITHUB_OUTPUT
fi
- name: Download cdt
uses: AntelopeIO/asset-artifact-download-action@v3
with:
owner: AntelopeIO
repo: cdt
file: 'cdt_.*amd64.deb'
target: '${{steps.versions.outputs.cdt-target}}'
prereleases: ${{fromJSON(steps.versions.outputs.cdt-prerelease)}}
artifact-name: cdt_ubuntu_package_amd64
token: ${{github.token}}
- name: Download leap-dev
uses: AntelopeIO/asset-artifact-download-action@v3
with:
owner: AntelopeIO
repo: leap
file: 'leap-dev.*ubuntu22\.04_amd64.deb'
target: '${{steps.versions.outputs.leap-dev-target}}'
prereleases: ${{fromJSON(steps.versions.outputs.leap-dev-prerelease)}}
artifact-name: leap-dev-ubuntu22-amd64
container-package: experimental-binaries
token: ${{github.token}}
- name: Install packages
run: |
sudo apt install ./*.deb
sudo apt-get install cmake
rm ./*.deb
- uses: actions/checkout@v4
with:
path: src
- name: Build
run: |
mkdir build
cd build
echo =====
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=yes ..
echo =====
make -j $(nproc) VERBOSE=1
echo =====
cd ..
tar -pczf build.tar.gz build
echo =====
mkdir built-contracts
cp \
build/contracts/eosio.bios/eosio.bios.abi \
build/contracts/eosio.bios/eosio.bios.wasm \
build/contracts/eosio.msig/eosio.msig.abi \
build/contracts/eosio.msig/eosio.msig.wasm \
build/contracts/eosio.system/.powerup/powup.results.abi \
build/contracts/eosio.system/.rex/rex.results.abi \
build/contracts/eosio.system/eosio.system.abi \
build/contracts/eosio.system/eosio.system.wasm \
build/contracts/eosio.token/eosio.token.abi \
build/contracts/eosio.token/eosio.token.wasm \
build/contracts/eosio.wrap/eosio.wrap.abi \
build/contracts/eosio.wrap/eosio.wrap.wasm \
built-contracts
ls -l built-contracts
- name: Upload build
uses: actions/upload-artifact@v1
with:
name: ubuntu-2204-build
path: build.tar.gz
- name: Upload built contracts
uses: actions/upload-artifact@v1
with:
name: built-contracts
path: built-contracts
ubuntu-2204-parallel-test:
name: Ubuntu 22.04 | Parallel Test
runs-on: ubuntu-22.04
needs: ubuntu-2204-build
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive
fetch-depth: 0
- name: Download build
uses: actions/download-artifact@v1
with:
name: ubuntu-2204-build
- name: Parallel Test
run: |
set -e
tar -xzf ubuntu-2204-build/build.tar.gz
export DOCKER="docker run --rm -v $(pwd):/root/target ${BUILDER_IMAGE}"
docker pull ${BUILDER_IMAGE}
${DOCKER} bash -c 'cd build/tests && ctest -j $(nproc)'