Skip to content

Set source-type flag required #8897

Set source-type flag required

Set source-type flag required #8897

Workflow file for this run

name: Golang Unit and Integration Tests
on:
push:
branches:
- "master"
paths:
- "**.go"
pull_request:
branches:
- "master"
paths:
- "**.go"
workflow_dispatch:
inputs:
logLevel:
description: "Log level"
required: true
default: "warning"
jobs:
golangci:
strategy:
matrix:
go: [1.21]
os: [ubuntu-22.04]
name: golangci-lint
if: github.repository == 'meshery/meshery'
runs-on: ${{ matrix.os }}
steps:
- uses: actions/setup-go@master
with:
go-version: ${{ matrix.go }}
- uses: actions/checkout@v4
- name: golangci-lint
uses: golangci/golangci-lint-action@v4
with:
version: v1.54
args: --config=.golangci.yml --timeout=10m
unit-tests:
name: Unit tests
runs-on: ubuntu-22.04
needs: golangci
steps:
- uses: actions/checkout@master
with:
fetch-depth: 2
- name: Install lynx for xdg-open support
run: sudo apt-get install lynx
- name: Setup Go
uses: actions/setup-go@master
with:
go-version: "1.21"
- name: Run coverage
run: go test --short ./... -race -coverprofile=coverage.txt -covermode=atomic
- name: Upload coverage to Codecov
if: github.repository == 'meshery/meshery'
uses: codecov/codecov-action@v4.3.0
with:
files: ./coverage.txt
flags: unittests
integration-tests:
name: Integration tests
runs-on: ubuntu-22.04
needs: golangci
steps:
- uses: actions/checkout@master
with:
fetch-depth: 2
- name: Install lynx for xdg-open support
run: sudo apt-get install lynx
- name: Setup Go
uses: actions/setup-go@master
with:
go-version: "1.21"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Create k8s Kind Cluster
uses: helm/kind-action@v1.9.0
with:
cluster_name: "kind-cluster"
- name: Run coverage
run: |
cd mesheryctl;
make;
./mesheryctl system start -p docker;
./mesheryctl system update -y;
./mesheryctl system status -y;
./mesheryctl system restart -y;
./mesheryctl system check --preflight;
./mesheryctl system stop -y;
echo "Running Mesheryctl with Docker completed."
./mesheryctl system start -p kubernetes;
./mesheryctl system update -y;
./mesheryctl system status -y;
./mesheryctl system restart -y;
./mesheryctl system check --preflight;
./mesheryctl system stop -y;
echo "Running Mesheryctl with Kubernetes completed."
- name: Upload coverage to Codecov
if: github.repository == 'meshery/meshery'
uses: codecov/codecov-action@v3
with:
files: ./coverage.txt
flags: gointegrationtests