mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-05 21:14:53 +00:00
ci: only run when applicable (#4752)
- only run tests when .go, .mod, .sum files have been touched - only run proto checks when .proto files have been touched Signed-off-by: Marko Baricevic marbar3778@yahoo.com
This commit is contained in:
9
.github/workflows/proto.yml
vendored
9
.github/workflows/proto.yml
vendored
@@ -5,8 +5,15 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- uses: docker-practice/actions-setup-docker@master
|
||||
- uses: technote-space/get-diff-action@v1
|
||||
id: git_diff
|
||||
with:
|
||||
SUFFIX_FILTER: .proto
|
||||
SET_ENV_NAME_INSERTIONS: 1
|
||||
SET_ENV_NAME_LINES: 1
|
||||
- name: lint
|
||||
run: make proto-lint
|
||||
if: "env.GIT_DIFF != ''"
|
||||
- name: check-breakage
|
||||
run: make proto-check-breaking-ci
|
||||
if: "env.GIT_DIFF != ''"
|
||||
|
||||
36
.github/workflows/tests.yml
vendored
36
.github/workflows/tests.yml
vendored
@@ -7,6 +7,23 @@ on:
|
||||
- release/**
|
||||
|
||||
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:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
@@ -14,6 +31,7 @@ jobs:
|
||||
env:
|
||||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
||||
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master'"
|
||||
|
||||
build:
|
||||
name: Build
|
||||
runs-on: ubuntu-latest
|
||||
@@ -33,7 +51,7 @@ jobs:
|
||||
|
||||
test_abci_apps:
|
||||
runs-on: ubuntu-latest
|
||||
needs: Build
|
||||
needs: [Build, Diff]
|
||||
steps:
|
||||
- uses: actions/setup-go@v2-beta
|
||||
- name: Set GOBIN
|
||||
@@ -50,7 +68,7 @@ jobs:
|
||||
|
||||
test_abci_cli:
|
||||
runs-on: ubuntu-latest
|
||||
needs: Build
|
||||
needs: [Build, Diff]
|
||||
steps:
|
||||
- uses: actions/setup-go@v2-beta
|
||||
- name: Set GOBIN
|
||||
@@ -68,15 +86,25 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
needs: Build
|
||||
steps:
|
||||
- uses: actions/setup-go@v2-beta
|
||||
- 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: Set GOBIN
|
||||
run: |
|
||||
echo "::add-path::$(go env GOPATH)/bin"
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/go/bin
|
||||
key: ${{ runner.os }}-go-tm-binary
|
||||
if: "env.GIT_DIFF != ''"
|
||||
- name: test_apps
|
||||
run: test/app/test.sh
|
||||
shell: bash
|
||||
if: "env.GIT_DIFF != ''"
|
||||
|
||||
Reference in New Issue
Block a user