From f880da9aa1768732a413f99f3a1039e856d273d9 Mon Sep 17 00:00:00 2001 From: esimov Date: Tue, 26 Oct 2021 16:47:19 +0300 Subject: [PATCH] ci: github actions --- .github/workflows/ci.yml | 49 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..eb41c1f --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,49 @@ +name: install + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + name: Build + strategy: + fail-fast: false + matrix: + go-version: [~1.16, ~1.17] + os: [ubuntu-latest, macos-latest] + runs-on: ${{ matrix.os }} + env: + GO111MODULE: "on" + steps: + - name: Install Go + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + + - name: Cache-Go + uses: actions/cache@v1 + with: + path: | + ~/go/pkg/mod # Module download cache + ~/.cache/go-build # Build cache (Linux) + ~/Library/Caches/go-build # Build cache (Mac) + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + + + - name: Checkout code + uses: actions/checkout@v2 + + - name: Download Go modules + run: go mod download + + - name: Build project + id: makefile + run: make + + - name: Test + run: go test -v ./core/... -run=. \ No newline at end of file