Skip to content

Commit 196e78c

Browse files
committed
ci: change to use GitHub actions
Signed-off-by: PoAn Yang <[email protected]>
1 parent fe00de2 commit 196e78c

File tree

3 files changed

+59
-6
lines changed

3 files changed

+59
-6
lines changed

.github/workflows/build.yml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: build
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
jobs:
8+
build-amd64:
9+
name: Build AMD64 binaries
10+
runs-on: longhorn-infra-amd64-runners
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
15+
- name: Install make curl git
16+
run: |
17+
sudo apt update
18+
sudo apt-get -y install make curl git
19+
20+
# Build binaries
21+
- name: Run ci
22+
run: make ci
23+
24+
- uses: codecov/codecov-action@v4
25+
with:
26+
files: ./coverage.out
27+
flags: unittests
28+
token: ${{ secrets.CODECOV_TOKEN }}
29+
30+
build-arm64:
31+
name: Build ARM64 binaries
32+
runs-on: longhorn-infra-arm64-runners
33+
steps:
34+
- name: Checkout code
35+
uses: actions/checkout@v4
36+
37+
- name: Install make curl git
38+
run: |
39+
sudo apt update
40+
sudo apt-get -y install make curl git
41+
42+
# Build binaries
43+
- name: Run ci
44+
run: make ci
45+
46+
- uses: codecov/codecov-action@v4
47+
with:
48+
files: ./coverage.out
49+
flags: unittests
50+
token: ${{ secrets.CODECOV_TOKEN }}

Dockerfile.dapper

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM registry.suse.com/bci/bci-base:15.5
22

3-
ARG DAPPER_HOST_ARCH=amd64
3+
ARG DAPPER_HOST_ARCH
44
ARG http_proxy
55
ARG https_proxy
66
ENV HOST_ARCH=${DAPPER_HOST_ARCH} ARCH=${DAPPER_HOST_ARCH}
@@ -21,7 +21,7 @@ RUN zypper -n addrepo --refresh https://download.opensuse.org/repositories/syste
2121
zypper -n addrepo --refresh https://download.opensuse.org/repositories/devel:languages:python:backports/SLE_15/devel:languages:python:backports.repo && \
2222
zypper --gpg-auto-import-keys ref
2323

24-
RUN zypper -n install cmake curl wget git gcc tar xsltproc docbook-xsl-stylesheets python3 meson ninja python3-pip \
24+
RUN zypper -n install cmake curl wget git gcc unzip tar xsltproc docbook-xsl-stylesheets python3 meson ninja python3-pip \
2525
e2fsprogs xfsprogs util-linux-systemd python3-pyelftools libcmocka-devel device-mapper
2626

2727
# Install Go & tools
@@ -30,8 +30,9 @@ ENV GOLANG_ARCH_amd64=amd64 GOLANG_ARCH_arm64=arm64 GOLANG_ARCH_s390x=s390x GOLA
3030
RUN wget -O - https://storage.googleapis.com/golang/go1.22.2.linux-${!GOLANG_ARCH}.tar.gz | tar -xzf - -C /usr/local
3131
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.55.2
3232

33-
3433
# Build SPDK
34+
ENV HUGEMEM=1024
35+
RUN echo "vm.nr_hugepages=$((HUGEMEM/2))" >> /etc/sysctl.conf
3536
ENV SPDK_DIR /usr/src/spdk
3637
ENV SPDK_COMMIT_ID 62a8f8a9c5ac99f6e63d654f6fc6c427c5d8815b
3738
RUN git clone https://github.com/longhorn/spdk.git ${SPDK_DIR} --recursive && \
@@ -64,16 +65,18 @@ RUN cd /usr/src && \
6465
make && \
6566
make install
6667

67-
# Build nvme-cli 2.5
68+
# Build nvme-cli 2.7.1
6869
ENV NVME_CLI_DIR /usr/src/nvme-cli
69-
ENV NVME_CLI_COMMIT_ID d6c07e0de9be777009ebb9ab7475bee1ae3e0e95
70+
ENV NVME_CLI_COMMIT_ID dcdad6f5d70ffb2fa151f229db048180671eb1fe
7071
RUN git clone https://github.com/linux-nvme/nvme-cli.git ${NVME_CLI_DIR} && \
7172
cd ${NVME_CLI_DIR} && \
7273
git checkout ${NVME_CLI_COMMIT_ID} && \
7374
meson setup --force-fallback-for=libnvme .build && \
7475
meson compile -C .build && \
7576
meson install -C .build
7677

78+
RUN ldconfig
79+
7780
VOLUME /tmp
7881
ENV TMPDIR /tmp
7982
ENTRYPOINT ["./scripts/entry"]

scripts/test

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ trap "umount /dev && umount /sys" EXIT
2121

2222
PACKAGES="$(find -name '*.go' | xargs -I{} dirname {} | cut -f2 -d/ | sort -u | grep -Ev '(^\.$|.git|.trash-cache|vendor|bin)' | sed -e 's!^!./!' -e 's!$!/...!')"
2323

24-
go test -v -race -cover ${PACKAGES}
24+
go test -v -race -cover -coverprofile=coverage.out ${PACKAGES}

0 commit comments

Comments
 (0)