ci: check git diff on each job (#4770)

This commit is contained in:
Marko
2020-04-29 14:55:15 +02:00
committed by GitHub
parent fd71c6844f
commit 1e925acd04
2 changed files with 33 additions and 24 deletions

View File

@@ -100,7 +100,7 @@ jobs:
mkdir -p /tmp/logs /tmp/workspace/profiles mkdir -p /tmp/logs /tmp/workspace/profiles
for pkg in $(go list github.com/tendermint/tendermint/... | circleci tests split --split-by=timings); do for pkg in $(go list github.com/tendermint/tendermint/... | circleci tests split --split-by=timings); do
id=$(basename "$pkg") id=$(basename "$pkg")
go test -v -timeout 5m -mod=readonly -race -coverprofile=/tmp/workspace/profiles/$id.out -covermode=atomic "$pkg" | tee "/tmp/logs/$id-$RANDOM.log" go test -timeout 5m -mod=readonly -race -coverprofile=/tmp/workspace/profiles/$id.out -covermode=atomic "$pkg" | tee "/tmp/logs/$id-$RANDOM.log"
done done
- persist_to_workspace: - persist_to_workspace:
root: /tmp/workspace root: /tmp/workspace

View File

@@ -7,23 +7,6 @@ on:
- release/** - release/**
jobs: jobs:
Diff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: technote-space/get-diff-action@v1
id: git_diff
with:
SUFFIX_FILTER: |
.go
.mod
.sum
SET_ENV_NAME_INSERTIONS: 1
SET_ENV_NAME_LINES: 1
- name: test
run: exit 1
if: "env.GIT_DIFF == ''"
cleanup-runs: cleanup-runs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
@@ -36,24 +19,40 @@ jobs:
name: Build name: Build
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/setup-go@v2-beta - uses: technote-space/get-diff-action@v1
with:
SUFFIX_FILTER: |
.go
.mod
.sum
SET_ENV_NAME_INSERTIONS: 1
SET_ENV_NAME_LINES: 1
- name: Set GOBIN - name: Set GOBIN
run: | run: |
echo "::add-path::$(go env GOPATH)/bin" echo "::add-path::$(go env GOPATH)/bin"
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: install - name: install
run: make install install_abci run: make install install_abci
if: "env.GIT_DIFF != ''"
# Cache bin # Cache bin
- uses: actions/cache@v1 - uses: actions/cache@v1
with: with:
path: ~/go/bin path: ~/go/bin
key: ${{ runner.os }}-go-tm-binary key: ${{ runner.os }}-go-tm-binary
if: "env.GIT_DIFF != ''"
test_abci_apps: test_abci_apps:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [Build, Diff] needs: Build
steps: steps:
- uses: actions/setup-go@v2-beta - uses: technote-space/get-diff-action@v1
with:
SUFFIX_FILTER: |
.go
.mod
.sum
SET_ENV_NAME_INSERTIONS: 1
SET_ENV_NAME_LINES: 1
- name: Set GOBIN - name: Set GOBIN
run: | run: |
echo "::add-path::$(go env GOPATH)/bin" echo "::add-path::$(go env GOPATH)/bin"
@@ -62,15 +61,24 @@ jobs:
with: with:
path: ~/go/bin path: ~/go/bin
key: ${{ runner.os }}-go-tm-binary key: ${{ runner.os }}-go-tm-binary
if: "env.GIT_DIFF != ''"
- name: test_abci_apps - name: test_abci_apps
run: abci/tests/test_app/test.sh run: abci/tests/test_app/test.sh
shell: bash shell: bash
if: "env.GIT_DIFF != ''"
test_abci_cli: test_abci_cli:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [Build, Diff] needs: Build
steps: steps:
- uses: actions/setup-go@v2-beta - uses: technote-space/get-diff-action@v1
with:
SUFFIX_FILTER: |
.go
.mod
.sum
SET_ENV_NAME_INSERTIONS: 1
SET_ENV_NAME_LINES: 1
- name: Set GOBIN - name: Set GOBIN
run: | run: |
echo "::add-path::$(go env GOPATH)/bin" echo "::add-path::$(go env GOPATH)/bin"
@@ -79,8 +87,10 @@ jobs:
with: with:
path: ~/go/bin path: ~/go/bin
key: ${{ runner.os }}-go-tm-binary key: ${{ runner.os }}-go-tm-binary
if: "env.GIT_DIFF != ''"
- run: abci/tests/test_cli/test.sh - run: abci/tests/test_cli/test.sh
shell: bash shell: bash
if: "env.GIT_DIFF != ''"
test_apps: test_apps:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -88,7 +98,6 @@ jobs:
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: technote-space/get-diff-action@v1 - uses: technote-space/get-diff-action@v1
id: git_diff
with: with:
SUFFIX_FILTER: | SUFFIX_FILTER: |
.go .go