-
Notifications
You must be signed in to change notification settings - Fork 8
131 lines (120 loc) · 3.75 KB
/
build.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
on:
push:
pull_request:
name: build
jobs:
build:
name: build
runs-on: self-hosted
steps:
env:
USERNAME: ${{ secrets.ZOTHUB_USERNAME }}
PASSWORD: ${{ secrets.ZOTHUB_PASSWORD }}
- name: Set up environment
run: |
mkdir ~/bin
echo "PATH=$HOME/bin:$PATH" >> $GITHUB_ENV
- name: Check out git
uses: actions/checkout@v3
- name: Set up golang
uses: actions/setup-go@v3
with:
go-version: 1.21
- name: setup host
run: |
bash ./tools/setup-host.bash
- name: lint
run: |
make gofmt
TOPDIR=$(git rev-parse --show-toplevel)
echo "setting TOPDIR=${TOPDIR}"
echo "TOPDIR=${TOPDIR}" >> $GITHUB_ENV
- name: make
run: |
go get -v ./...
make
- name: test
run: |
nohup ~/bin/machined > /tmp/machined.out 2>&1 &
timeout 60m make test
timeout 20m bats tests/livecd1.bats
timeout 20m bats tests/livecd2.bats
- name: show journal output
if: always()
run: |
set -x
cat /tmp/machined.out
sudo dmesg
sudo df -h
touch /tmp/fini
# Uncomment the below to check the job after done
# while [ ! -f /tmp/shutdown ]; do sleep 5s; done
- name: Rename Binary
run: |
cp trust trust-linux-amd64
cp mosb mosb-linux-amd64
cp mosctl mosctl-linux-amd64
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
mosb-linux-amd64
mosctl-linux-amd64
trust-linux-amd64
- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: publish provision and install layer
if: startsWith(github.ref, 'refs/tags/')
run: |
make publish
env:
ZOT_VERSION=2.0.0-rc5
ROOTFS_VERSION=v0.0.17.231018
TOPDIR=${{ env.TOPDIR }}
URL=docker://zothub.io/machine/bootkit
build_arm64:
runs-on: ubuntu-latest
name: Build on ubuntu-latest arm64
steps:
- uses: actions/checkout@v3
- uses: uraimo/run-on-arch-action@v2
with:
arch: aarch64
distro: ubuntu22.04
githubToken: ${{ github.token }}
install: |
apt-get -y update;
apt-get install -q -y git golang-go;
apt-get install -y bats curl golang make openssl swtpm tpm2-tools \
libcryptsetup-dev libgpgme-dev libcap-dev qemu-kvm \
libdevmapper-dev libacl1-dev libarchive-tools pip python3-yaml \
sbsigntool squashfs-tools wget
pip install virt-firmware
mv /usr/lib/go /usr/lib/go.no || true
cd /tmp/
wget https://go.dev/dl/go1.21.0.linux-arm64.tar.gz
tar -C /usr/lib -zvxf go1.21.0.linux-arm64.tar.gz
rm /usr/bin/go /usr/bin/gofmt
ln -s /usr/lib/go/bin/go /usr/bin/go
ln -s /usr/lib/go/bin/gofmt /usr/bin/gofmt
run: |
git config --global --add safe.directory /home/runner/work/mos/mos
pwd
git describe --always --dirty
go version
make
make test-trust
- name: Rename Binary
run: |
mv mosb mosb-linux-arm64
mv mosctl mosctl-linux-arm64
mv trust trust-linux-arm64
- name: release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
trust-linux-arm64
mosb-linux-arm64
mosctl-linux-arm64