Skip to content

Commit

Permalink
ci: change to use GitHub actions
Browse files Browse the repository at this point in the history
Signed-off-by: PoAn Yang <[email protected]>
  • Loading branch information
FrankYang0529 committed Apr 29, 2024
1 parent e9439c0 commit 8f94d4b
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 5 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: build
on:
push:
branches:
- master
- v*
tags:
- v*
pull_request:
jobs:
build:
name: Build binaries
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

# Build binaries
- name: Run ci
run: make ci

- uses: codecov/codecov-action@v4
with:
files: ./coverage.out
flags: unittests
token: ${{ secrets.CODECOV_TOKEN }}
16 changes: 12 additions & 4 deletions Dockerfile.dapper
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ENV HOST_ARCH=${DAPPER_HOST_ARCH} ARCH=${DAPPER_HOST_ARCH}
ENV PATH /go/bin:$PATH
ENV DAPPER_DOCKER_SOCKET true
ENV DAPPER_ENV TAG REPO DRONE_REPO DRONE_PULL_REQUEST DRONE_COMMIT_REF
ENV DAPPER_OUTPUT bin
ENV DAPPER_OUTPUT bin coverage.out
ENV DAPPER_RUN_ARGS --privileged -v /dev:/host/dev -v /proc:/host/proc
ENV DAPPER_SOURCE /go/src/github.com/longhorn/go-iscsi-helper
WORKDIR ${DAPPER_SOURCE}
Expand All @@ -18,7 +18,7 @@ WORKDIR ${DAPPER_SOURCE}
RUN apt-get update && \
apt-get install -y cmake wget curl git \
devscripts debhelper bash-completion librdmacm-dev libibverbs-dev xsltproc docbook-xsl \
libconfig-general-perl libaio-dev libc6-dev iptables libltdl7
libconfig-general-perl libaio-dev libc6-dev iptables libltdl7 open-iscsi

# needed for ${!var} substitution
RUN rm -f /bin/sh && ln -s /bin/bash /bin/sh
Expand All @@ -36,13 +36,21 @@ ENV DOCKER_URL_amd64=https://download.docker.com/linux/ubuntu/dists/xenial/pool/

RUN wget ${!DOCKER_URL} -O docker_ce_${ARCH} && dpkg -i docker_ce_${ARCH}

# Build liblonghorn
RUN cd /usr/src && \
git clone https://github.com/rancher/liblonghorn.git && \
cd liblonghorn && \
git checkout 53d1c063b95efc8d949b095bd4bf04637230265f && \
make; \
make install

# Build TGT
RUN cd /usr/src && \
git clone https://github.com/rancher/tgt.git && \
cd tgt && \
git checkout 3a8bc4823b5390e046f7aa8231ed262c0365c42c && \
./scripts/build-pkg.sh deb && \
dpkg -i ./pkg/tgt_*.deb
make; \
make install

VOLUME /tmp
ENV TMPDIR /tmp
Expand Down
2 changes: 1 addition & 1 deletion scripts/test
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ echo Running tests

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

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

0 comments on commit 8f94d4b

Please sign in to comment.