From 45697b647ea9bd899853369ac27e0fb2e31cf2a9 Mon Sep 17 00:00:00 2001 From: PoAn Yang Date: Tue, 30 Apr 2024 17:20:45 +0800 Subject: [PATCH] ci: change to use GitHub actions Signed-off-by: PoAn Yang --- .github/workflows/build.yml | 40 +++++++++++++++++++++++++++++++++++++ Dockerfile.dapper | 8 ++------ 2 files changed, 42 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..0ff213a5 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,40 @@ +name: build +on: + push: + branches: + - main + pull_request: +jobs: + build-amd64: + name: Build AMD64 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 }} + + build-arm64: + name: Build ARM64 binaries + runs-on: oracle-aarch64-2cpu-8gb + 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 }} diff --git a/Dockerfile.dapper b/Dockerfile.dapper index d405c8b1..3b0875e0 100644 --- a/Dockerfile.dapper +++ b/Dockerfile.dapper @@ -1,4 +1,4 @@ -FROM registry.suse.com/bci/bci-base:15.5 +FROM registry.suse.com/bci/golang:1.22 ARG DAPPER_HOST_ARCH=amd64 ARG http_proxy @@ -24,13 +24,9 @@ RUN zypper -n addrepo --refresh https://download.opensuse.org/repositories/syste RUN zypper -n install cmake curl wget git gcc tar xsltproc docbook-xsl-stylesheets python3 meson ninja python3-pip \ e2fsprogs xfsprogs util-linux-systemd python3-pyelftools libcmocka-devel device-mapper -# Install Go & tools -ENV GOLANG_ARCH_amd64=amd64 GOLANG_ARCH_arm64=arm64 GOLANG_ARCH_s390x=s390x GOLANG_ARCH=GOLANG_ARCH_${ARCH} \ - GOPATH=/go PATH=/go/bin:/usr/local/go/bin:${PATH} SHELL=/bin/bash -RUN wget -O - https://storage.googleapis.com/golang/go1.22.2.linux-${!GOLANG_ARCH}.tar.gz | tar -xzf - -C /usr/local +# Install golangci-lint RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.55.2 - # Build SPDK ENV SPDK_DIR /usr/src/spdk ENV SPDK_COMMIT_ID 62a8f8a9c5ac99f6e63d654f6fc6c427c5d8815b