Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: change to use GitHub actions #102

Merged
merged 2 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: build
on:
push:
branches:
- master
pull_request:
jobs:
build:
name: Build binaries
runs-on: ubuntu-latest
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious, do we have other options?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 }}
2 changes: 1 addition & 1 deletion Dockerfile.dapper
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ RUN wget -O - https://storage.googleapis.com/golang/go1.22.2.linux-${!GOLANG_ARC
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.55.2

ENV DAPPER_SOURCE /go/src/github.com/longhorn/sparse-tools
ENV DAPPER_OUTPUT ./bin
ENV DAPPER_OUTPUT ./bin coverage.out
ENV DAPPER_DOCKER_SOCKET true
ENV DAPPER_ENV IMAGE REPO VERSION TAG
ENV HOME ${DAPPER_SOURCE}
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 -race -cover -tags=test ${PACKAGES}
go test -race -cover -tags=test ${PACKAGES} -coverprofile=coverage.out
3 changes: 1 addition & 2 deletions sparse/test/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,7 @@ func TestSyncAnyFile(t *testing.T) {
func testSyncAnyFile(t *testing.T, src, dst string, directIO, fastSync bool) {
// Sync
go func() {
err := rest.TestServer(context.Background(), port, dst, timeout)
assert.Nil(t, err)
_ = rest.TestServer(context.Background(), port, dst, timeout)
}()
err := SyncFile(src, localhost+":"+port, timeout, directIO, fastSync)

Expand Down
Loading