Skip to content

Commit a02be57

Browse files
committed
fix: build
Signed-off-by: Ramkumar Chinchani <[email protected]>
1 parent 2e7f5e0 commit a02be57

File tree

1 file changed

+22
-8
lines changed

1 file changed

+22
-8
lines changed

.github/workflows/build.yaml

+22-8
Original file line numberDiff line numberDiff line change
@@ -116,18 +116,31 @@ jobs:
116116
matrix:
117117
go-version: ${{fromJson(inputs.go-version)}}
118118
privilege-level: ${{fromJson(inputs.privilege-level)}}
119-
build-id: ${{fromJson(inputs.build-id)}}
120-
arch: ["aarch64"]
121-
name: "golang ${{ matrix.go-version }} privilege ${{ matrix.privilege-level }}"
119+
arch: ["arm64"]
120+
name: "golang ${{ matrix.go-version }} privilege ${{ matrix.privilege-level }} arch ${{ matrix.arch }}"
122121
steps:
123122
- uses: actions/checkout@v3
124123
- uses: benjlevesque/[email protected]
125124
id: short-sha
125+
- name: Setup Environment
126+
run: |
127+
gopath=$PWD/.build/gopath
128+
echo "GOPATH=$gopath" >> $GITHUB_ENV
129+
echo "GOCACHE=$gopath/gocache" >> $GITHUB_ENV
130+
echo "PATH=$gopath/bin:$PATH" >> $GITHUB_ENV
131+
echo "SLOW_TEST=${{inputs.slow-test}}" >> $GITHUB_ENV
132+
if [ "${{ matrix.arch }}" == "arm64" ]; then
133+
echo "QEMU_ARCH=aarch64" >> $GITHUB_ENV
134+
echo "BASE_IMAGE=docker://arm64v8/alpine:edge" >> $GITHUB_ENV
135+
fi
136+
137+
echo "PWD=$PWD"
138+
cat "$GITHUB_ENV"
126139
- uses: uraimo/run-on-arch-action@v2
127140
name: Build for ${{ matrix.arch }}
128141
id: runcmd
129142
with:
130-
arch: ${{ matrix.arch }}
143+
arch: ${{ env.QEMU_ARCH }}
131144
distro: ubuntu22.04
132145

133146
# Not required, but speeds up builds by storing container images in
@@ -137,15 +150,15 @@ jobs:
137150
dockerRunArgs: -v $GITHUB_WORKSPACE:/src --cgroupns=host
138151

139152
# Set an output parameter `uname` for use in subsequent steps
140-
run: |
153+
install: |
141154
uname -a
142155
echo ::set-output name=uname::$(uname -a)
143156
# setup golang
144157
apt-get update
145158
apt-get install -yy wget curl tar software-properties-common git pkgconf build-essential
146159
cd /tmp
147-
wget -N https://go.dev/dl/go1.20.5.linux-arm64.tar.gz
148-
rm -rf /usr/local/go && tar -C /usr/local -xzf go1.20.5.linux-arm64.tar.gz
160+
wget -N https://go.dev/dl/go1.20.5.linux-${{ matrix.arch }}.tar.gz
161+
rm -rf /usr/local/go && tar -C /usr/local -xzf go1.20.5.linux-${{ matrix.arch }}.tar.gz
149162
export PATH=$PATH:/usr/local/go/bin
150163
# install dependencies
151164
export GOPATH=/src
@@ -155,11 +168,12 @@ jobs:
155168
GO111MODULE=off go get github.com/opencontainers/umoci/cmd/umoci
156169
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin
157170
apt-get install -yy autoconf automake make autogen autoconf libtool binutils git squashfs-tools libcryptsetup-dev libdevmapper-dev cryptsetup-bin squashfuse
171+
run: |
158172
cd /src
159173
make go-download
160174
make show-info
161175
make stacker-dynamic VERSION_FULL=${{ matrix.build-id }}
162-
make stacker VERSION_FULL=${{ matrix.build-id }} STACKER_BUILD_BASE_IMAGE=docker://arm64v8/alpine:edge
176+
make stacker VERSION_FULL=${{ matrix.build-id }} STACKER_BUILD_BASE_IMAGE="$BASE_IMAGE"
163177
- name: Get the output
164178
# Echo the `uname` output parameter from the `runcmd` step
165179
run: |

0 commit comments

Comments
 (0)