Skip to content

Commit

Permalink
Merge pull request #471 from meshery/feat/ci
Browse files Browse the repository at this point in the history
Replace CI jobs, make sure the checking and coverage is reasonable
  • Loading branch information
acald-creator committed May 5, 2023
2 parents 937cc4d + 03eecfe commit 27cfe5f
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 44 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/approve-to-run-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Meshery-Operator CI

on:
pull_request:
branches: [ master ]
push:
branches: [ master ]

jobs:
golangci-lint:
strategy:
matrix:
platform: [ubuntu-22.04]
go-version: [1.19.x]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@master
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
args: --timeout=5m
codecov:
# golandci-lint need to be run before codecov and succeed
needs: golangci-lint
name: Code Coverage
if: github.repository == 'meshery/meshery-operator'
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@master
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.19.x
- name: Run unit tests
run: go test --short ./... -race -coverprofile=coverage.txt -covermode=atomic
- name: Upload coverage to Codecov
if: github.repository == 'meshery/meshery-operator'
uses: codecov/codecov-action@v3
with:
files: ./coverage.txt
flags: unittests
# if review comment includes approved or LGTM, run the tests
# if review comment includes changes requested, do not run the tests
# if review comment includes approved or LGTM, run the tests
build:
name: Build
if: github.event_name == 'pull_request' && (contains(github.event.pull_request.body, 'approved') || contains(github.event.pull_request.body, 'LGTM'))
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@master
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.19.x
- name: Build
run: make build
44 changes: 0 additions & 44 deletions .github/workflows/ci.yml

This file was deleted.

0 comments on commit 27cfe5f

Please sign in to comment.