Skip to content

Commit

Permalink
.github/workflows: run more parallel CI jobs (#976)
Browse files Browse the repository at this point in the history
* .github/workflows: run parallel CI jobs

* undo
  • Loading branch information
manav2401 authored Sep 5, 2023
1 parent 4d96b14 commit 530a233
Showing 1 changed file with 98 additions and 13 deletions.
111 changes: 98 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ concurrency:
cancel-in-progress: true

jobs:
tests:
build:
if: (github.event.action != 'closed' || github.event.pull_request.merged == true)
strategy:
matrix:
Expand All @@ -35,10 +35,6 @@ jobs:
if: runner.os == 'Linux'
run: sudo apt update && sudo apt install build-essential

- name: Golang-ci install
if: runner.os == 'Linux'
run: make lintci-deps

- uses: actions/cache@v3
with:
path: |
Expand All @@ -51,24 +47,69 @@ jobs:
- name: Build
run: make all

lint:
if: (github.event.action != 'closed' || github.event.pull_request.merged == true)
strategy:
matrix:
os: [ ubuntu-20.04 ] # list of os: https://github.com/actions/virtual-environments
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- run: |
git submodule update --init --recursive --force
git fetch --no-tags --prune --depth=1 origin +refs/heads/master:refs/remotes/origin/master
- uses: actions/setup-go@v3
with:
go-version: 1.20.x

- name: Install dependencies on Linux
if: runner.os == 'Linux'
run: sudo apt update && sudo apt install build-essential

- name: Golang-ci install
if: runner.os == 'Linux'
run: make lintci-deps

- name: Lint
if: runner.os == 'Linux'
run: make lint

unit-tests:
if: (github.event.action != 'closed' || github.event.pull_request.merged == true)
strategy:
matrix:
os: [ ubuntu-20.04 ] # list of os: https://github.com/actions/virtual-environments
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- run: |
git submodule update --init --recursive --force
git fetch --no-tags --prune --depth=1 origin +refs/heads/master:refs/remotes/origin/master
- uses: actions/setup-go@v3
with:
go-version: 1.20.x

- name: Install dependencies on Linux
if: runner.os == 'Linux'
run: sudo apt update && sudo apt install build-essential

- uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/Library/Caches/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-

- name: Test
run: make test

#- name: Data race tests
# run: make test-race

- name: test-integration
run: make test-integration

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
file: ./cover.out

# # TODO: make it work
# - name: Reproducible build test
# run: |
Expand All @@ -81,6 +122,50 @@ jobs:
# fi

integration-tests:
if: (github.event.action != 'closed' || github.event.pull_request.merged == true)
strategy:
matrix:
os: [ ubuntu-20.04 ] # list of os: https://github.com/actions/virtual-environments
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- run: |
git submodule update --init --recursive --force
git fetch --no-tags --prune --depth=1 origin +refs/heads/master:refs/remotes/origin/master
- uses: actions/setup-go@v3
with:
go-version: 1.20.x

- name: Install dependencies on Linux
if: runner.os == 'Linux'
run: sudo apt update && sudo apt install build-essential

- uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/Library/Caches/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-

- name: test-integration
run: make test-integration

codecov:
if: (github.event.action != 'closed' || github.event.pull_request.merged == true)
strategy:
matrix:
os: [ ubuntu-20.04 ] # list of os: https://github.com/actions/virtual-environments
runs-on: ${{ matrix.os }}
steps:
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
file: ./cover.out

matic-cli-tests:
if: (github.event.action != 'closed' || github.event.pull_request.merged == true)
strategy:
matrix:
Expand Down

0 comments on commit 530a233

Please sign in to comment.