From 5affabfad045047826891630ccba8e354e26b887 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Fri, 16 Oct 2020 15:51:39 +0300 Subject: [PATCH] [#100] Add GH Actions for DCO, tests and linter Add checks for DCO, local unit tests and linter Signed-off-by: Stanislav Bogatyrev --- .github/workflows/dco.yml | 21 ++++++++++++++ .github/workflows/go.yml | 59 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 .github/workflows/dco.yml create mode 100644 .github/workflows/go.yml diff --git a/.github/workflows/dco.yml b/.github/workflows/dco.yml new file mode 100644 index 000000000..40ed8fcb4 --- /dev/null +++ b/.github/workflows/dco.yml @@ -0,0 +1,21 @@ +name: DCO check + +on: + pull_request: + branches: + - master + +jobs: + commits_check_job: + runs-on: ubuntu-latest + name: Commits Check + steps: + - name: Get PR Commits + id: 'get-pr-commits' + uses: tim-actions/get-pr-commits@master + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: DCO Check + uses: tim-actions/dco@master + with: + commits: ${{ steps.get-pr-commits.outputs.commits }} diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml new file mode 100644 index 000000000..0542dc5b7 --- /dev/null +++ b/.github/workflows/go.yml @@ -0,0 +1,59 @@ +name: neofs-node tests + +on: + push: + branches: + - master + paths-ignore: + - '*.md' + pull_request: + branches: + - master + paths-ignore: + - '*.md' + +jobs: + test: + runs-on: ubuntu-20.04 + strategy: + matrix: + go: [ '1.14.x', '1.15.x' ] + steps: + - name: Setup go + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go }} + + - name: Check out code + uses: actions/checkout@v2 + + - name: Cache go mod + uses: actions/cache@v2 + with: + path: ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ matrix.go }}-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go-${{ matrix.go }}- + + - name: Get test dependencies + run: make test_dep + + - name: Run go test + run: go test -coverprofile=coverage.txt -covermode=atomic ./... + + - name: Codecov + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + run: bash <(curl -s https://codecov.io/bash) + + lint: + runs-on: ubuntu-20.04 + steps: + - name: Check out code + uses: actions/checkout@v2 + + - name: golangci-lint + uses: golangci/golangci-lint-action@v2 + with: + version: v1.29 + only-new-issues: true