Skip to content

Commit

Permalink
chore: isolated test worksflows for individual job runs (ChainSafe#1730)
Browse files Browse the repository at this point in the history
Co-authored-by: Arijit Das <arijitad.in@gmail.com>
  • Loading branch information
2 people authored and timwu20 committed Dec 6, 2021
1 parent 255967a commit bef7cc2
Show file tree
Hide file tree
Showing 8 changed files with 263 additions and 230 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/code-cov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
on: [pull_request]
name: code-cov
env:
GO111MODULE: on

jobs:
publish-code-coverage:
strategy:
matrix:
go-version: [1.15.x]
runs-on: ubuntu-latest
steps:
- id: go-cache-paths
run: |
echo "::set-output name=go-build::$(go env GOCACHE)"
echo "::set-output name=go-mod::$(go env GOMODCACHE)"
- uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- uses: actions/checkout@v2

# cache go build cache
- name: Cache go modules
uses: actions/cache@v2
with:
path: ${{ steps.go-cache-paths.outputs.go-build }}
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-build

# cache go mod cache
- name: Cache go modules
uses: actions/cache@v2
with:
path: ${{ steps.go-cache-paths.outputs.go-mod }}
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-mod

- name: Install Subkey
run: |
wget -P $HOME/.local/bin/ https://chainbridge.ams3.digitaloceanspaces.com/subkey-v2.0.0
mv $HOME/.local/bin/subkey-v2.0.0 $HOME/.local/bin/subkey
chmod +x $HOME/.local/bin/subkey
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Generate coverage report
run: |
go test ./... -short -coverprofile=coverage.out -covermode=atomic -timeout=20m
- uses: codecov/codecov-action@v1
with:
if_ci_failed: success
informational: true
files: ./coverage.out
flags: unit-tests
name: coverage
verbose: true
29 changes: 29 additions & 0 deletions .github/workflows/docker-grandpa.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
on: [pull_request]
name: docker-grandpa
env:
GO111MODULE: on

jobs:
docker-grandpa-tests:
runs-on: ubuntu-latest
steps:
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Build
id: docker_build
uses: docker/build-push-action@v2
with:
load: true
file: ./Dockerfile
platforms: linux/amd64
push: false
tags: chainsafe/gossamer:test
-
name: Run grandpa
run: |
docker run chainsafe/gossamer:test sh -c "make it-grandpa"
29 changes: 29 additions & 0 deletions .github/workflows/docker-js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
on: [pull_request]
name: docker-js
env:
GO111MODULE: on

jobs:
docker-polkadotjs-tests:
runs-on: ubuntu-latest
steps:
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Build
id: docker_build
uses: docker/build-push-action@v2
with:
load: true
file: ./Dockerfile
platforms: linux/amd64
push: false
tags: chainsafe/gossamer:test
-
name: Run polkadotjs tests
run: |
docker run chainsafe/gossamer:test sh -c "make it-polkadotjs"
29 changes: 29 additions & 0 deletions .github/workflows/docker-rpc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
on: [pull_request]
name: docker-rpc
env:
GO111MODULE: on

jobs:
docker-rpc-tests:
runs-on: ubuntu-latest
steps:
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Build
id: docker_build
uses: docker/build-push-action@v2
with:
load: true
file: ./Dockerfile
platforms: linux/amd64
push: false
tags: chainsafe/gossamer:test
-
name: Run rpc tests
run: |
docker run chainsafe/gossamer:test sh -c "make it-rpc"
29 changes: 29 additions & 0 deletions .github/workflows/docker-stable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
on: [pull_request]
name: docker-stable
env:
GO111MODULE: on

jobs:
docker-stable-tests:
runs-on: ubuntu-latest
steps:
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Build
id: docker_build
uses: docker/build-push-action@v2
with:
load: true
file: ./Dockerfile
platforms: linux/amd64
push: false
tags: chainsafe/gossamer:test
-
name: Run stable tests
run: |
docker run chainsafe/gossamer:test sh -c "make it-stable"
29 changes: 29 additions & 0 deletions .github/workflows/docker-stress.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
on: [pull_request]
name: docker-stress
env:
GO111MODULE: on

jobs:
docker-stress-tests:
runs-on: ubuntu-latest
steps:
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Build
id: docker_build
uses: docker/build-push-action@v2
with:
load: true
file: ./Dockerfile
platforms: linux/amd64
push: false
tags: chainsafe/gossamer:test
-
name: Run stress
run: |
docker run chainsafe/gossamer:test sh -c "make it-stress"
Loading

0 comments on commit bef7cc2

Please sign in to comment.