Skip to content

Commit

Permalink
chore: optimize CI workflows (#1676)
Browse files Browse the repository at this point in the history
* test no tparse

* remove comment in app.go

* merge jobs

* remove revive - it's already in golangci-lint

* renames

* rename build jobs
  • Loading branch information
robert-zaremba committed Dec 23, 2022
1 parent 811ef26 commit 3359b3e
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 67 deletions.
51 changes: 0 additions & 51 deletions .github/workflows/build.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/lint-pr.yml
@@ -1,4 +1,4 @@
name: Lint
name: Lint-Title
on:
pull_request_target:
types:
Expand All @@ -12,7 +12,7 @@ concurrency:

jobs:
main:
name: Run PR Title Linter
name: PR Title Linter
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
Expand Down
10 changes: 3 additions & 7 deletions .github/workflows/lint.yml
Expand Up @@ -14,7 +14,7 @@ jobs:
golangci:
name: Run golangci-lint
runs-on: ubuntu-latest
timeout-minutes: 10
timeout-minutes: 8
steps:
- uses: actions/checkout@v3
- uses: technote-space/get-diff-action@v6.1.2
Expand All @@ -26,18 +26,14 @@ jobs:
with:
go-version: 1.19
cache: true
- name: revive lint
uses: morphy2k/revive-action@v2
with:
config: .revive.toml
exclude: "*.pb.go;*.pb.gw.go;*.pulsar.go;swagger/..."
path: "./..."

- name: golangci-lint main
uses: golangci/golangci-lint-action@v3
if: env.GIT_DIFF
with:
version: latest
args: --timeout 8m

- name: golangci-lint pricefeeder
uses: golangci/golangci-lint-action@v3
if: ${{ contains(env.GIT_DIFF, 'price-feeder/') }}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
41 changes: 36 additions & 5 deletions .github/workflows/tests.yml
Expand Up @@ -17,8 +17,6 @@ jobs:
- uses: actions/setup-go@v3
with:
go-version: 1.19
- name: Display Go Version
run: go version
- uses: actions/cache@v3
id: cache-go-tparse
with:
Expand All @@ -29,6 +27,42 @@ jobs:
run: |
go install github.com/mfridman/tparse@v0.11.1
build:
runs-on: ubuntu-latest
strategy:
matrix:
arch: [amd64, arm64]
targetos: [darwin, linux]
name: umeed ${{ matrix.targetos }}-${{ matrix.arch }}
steps:
- uses: actions/checkout@v3
- name: Cache binaries
id: cache-binaries
uses: actions/cache@v3
with:
path: ./cmd/umeed/umeed
key: umeed-${{ matrix.targetos }}-${{ matrix.arch }}
- uses: technote-space/get-diff-action@v6.1.2
with:
PATTERNS: |
**/**.go
go.mod
go.sum
- name: Setup go
if: steps.cache-binaries.outputs.cache-hit != 'true' && env.GIT_DIFF
uses: actions/setup-go@v3
with:
go-version: 1.19
cache: true
env:
GOOS: ${{ matrix.targetos }}
GOARCH: ${{ matrix.arch }}
- name: Compile
if: steps.cache-binaries.outputs.cache-hit != 'true' && env.GIT_DIFF
run: |
go mod download
make build
test-unit-cover:
runs-on: ubuntu-latest
needs: install-tparse
Expand Down Expand Up @@ -114,9 +148,6 @@ jobs:
run: |
cd price-feeder && make test-unit
# build-umeed:
# uses: ./.github/workflows/build.yml

liveness-test:
needs: install-tparse
# needs: build-umeed
Expand Down
2 changes: 0 additions & 2 deletions app/app.go
@@ -1,7 +1,5 @@
package app

// todo: trigger tests

import (
"encoding/json"
"fmt"
Expand Down

0 comments on commit 3359b3e

Please sign in to comment.