-
Notifications
You must be signed in to change notification settings - Fork 20
137 lines (115 loc) · 4.6 KB
/
main.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
name: Build
on: [push]
env:
TOOLCHAIN_IMAGE: ${{ github.repository_owner }}/toolchain
TOOLCHAIN_TAG: 0.15.0
jobs:
tools:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Login to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Export makefile variables
run: make env >> $GITHUB_ENV
- name: Download and check dependencies
run: make checksum
- name: Buildx setup
uses: docker/setup-buildx-action@v2
- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v4
with:
images: ${{ secrets.DOCKER_ORGANIZATION }}/machine-emulator-tools
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Build [${{ env.MACHINE_EMULATOR_TOOLS_TAR_GZ }}]
id: docker_build
uses: docker/build-push-action@v4
with:
context: .
builder: ${{ steps.buildx.outputs.name }}
tags: ${{ steps.docker_meta.outputs.tags }}
push: false
load: true
build-args: |
MACHINE_EMULATOR_TOOLS_TAR_GZ=${{ env.MACHINE_EMULATOR_TOOLS_TAR_GZ }}
MACHINE_EMULATOR_TOOLS_DEB=${{ env.MACHINE_EMULATOR_TOOLS_DEB }}
MACHINE_EMULATOR_TOOLS_VERSION=${{ env.MACHINE_EMULATOR_TOOLS_VERSION }}
LINUX_SOURCES_VERSION=${{ env.LINUX_SOURCES_VERSION }}
LINUX_SOURCES_FILEPATH=${{ env.LINUX_SOURCES_FILEPATH }}
RNDADDENTROPY_VERSION=${{ env.RNDADDENTROPY_VERSION }}
RNDADDENTROPY_FILEPATH=${{ env.RNDADDENTROPY_FILEPATH }}
cache-from: type=gha,scope=regular,mode=max
cache-to: type=gha,scope=regular
- name: Retrieve artifacts
run: make copy MACHINE_EMULATOR_TOOLS_IMAGE=`echo "${{ steps.docker_meta.outputs.tags }}" | head -1 | cut -d "," -f 1 | xargs`
- name: Upload [${{ env.MACHINE_EMULATOR_TOOLS_TAR_GZ }}]
uses: actions/upload-artifact@v3
with:
name: ${{ env.MACHINE_EMULATOR_TOOLS_TAR_GZ }}
path: ${{ env.MACHINE_EMULATOR_TOOLS_TAR_GZ }}
- name: Upload [${{ env.MACHINE_EMULATOR_TOOLS_DEB }}]
uses: actions/upload-artifact@v3
with:
name: ${{ env.MACHINE_EMULATOR_TOOLS_DEB }}
path: ${{ env.MACHINE_EMULATOR_TOOLS_DEB }}
- name: Checksum artifacts
run: sha512sum ${{ env.MACHINE_EMULATOR_TOOLS_DEB }} ${{ env.MACHINE_EMULATOR_TOOLS_TAR_GZ }} > sha512sums.txt
- name: Upload [checksums.txt]
uses: actions/upload-artifact@v3
with:
name: sha512sums.txt
path: sha512sums.txt
- uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/v')
with:
prerelease: true
files: |
sha512sums.txt
${{ env.MACHINE_EMULATOR_TOOLS_TAR_GZ }}
${{ env.MACHINE_EMULATOR_TOOLS_DEB }}
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Login to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build yield tool
run: cd linux/htif && make toolchain-exec CONTAINER_COMMAND="/usr/bin/make yield.toolchain"
- name: Build ioctl-echo-loop tool
run: cd linux/rollup/ioctl-echo-loop && make toolchain-exec CONTAINER_COMMAND="/usr/bin/make ioctl-echo-loop.toolchain"
- name: Build rollup tool
run: cd linux/rollup/rollup && make toolchain-exec CONTAINER_COMMAND="/usr/bin/make rollup.toolchain"
- name: Build rollup http server
run: cd linux/rollup/http/rollup-http-server && ./build.sh
- name: Build echo dapp
run: cd linux/rollup/http/echo-dapp && ./build.sh
- name: Test rollup-http-server and echo-dapp client
run: |
cd linux/rollup/http/rollup-http-server
USE_ROLLUP_BINDINGS_MOCK=1 cargo test -- --show-output --test-threads=1