Skip to content

ci: test output minified json #14

ci: test output minified json

ci: test output minified json #14

Workflow file for this run

name: main
concurrency:
group: main-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches:
- 'main'
tags-ignore:
- 'main'
pull_request:
branches:
- 'main'
workflow_dispatch:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Lint all packages
uses: ./.github/actions/golangci-lint-monorepo-action
with:
go-version: '>=1.21.0'
golangci-lint-version: latest
test:
needs: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Test all packages
id: coveredmodules
uses: ./.github/actions/go-test-monorepo-action
with:
go-version: '>=1.21.0'
- run: echo modules "${{ steps.coveredmodules.outputs.modules }}"
shell: bash
upload-coverage:
needs: test
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Upload coverage
run: echo ${{ fromJson(needs.test.outputs.modules) }}
# test:
# needs: lint
# runs-on: ubuntu-latest
# strategy:
# matrix:
# package:
# - ./
# - pkg/cli/ansicolor
# - pkg/devel/testutils
# - pkg/scheduling/cron
# - pkg/strings/bexp
# - pkg/vars
# - pkg/version
# fail-fast: false
# steps:
# - name: Set up Go
# uses: actions/setup-go@v5
# with:
# go-version: '>=1.21.5'
# - uses: actions/checkout@v4
# - name: generate coverage
# continue-on-error: true
# working-directory: ./${{ matrix.package }}
# run: go test -race -coverpkg=./... -coverprofile=coverage.out ./...
# - name: Check if coverage data exists
# if: success() || failure()
# id: check-coverage
# working-directory: ./${{ matrix.package }}
# run: |
# if [ $(wc -l <coverage.out) -gt 1 ]; then
# echo "::set-output name=coverage_data_exists::true"
# else
# echo "::set-output name=coverage_data_exists::false"
# fi
# - name: upload coverage
# if: steps.check-coverage.outputs.coverage_data_exists == 'true'
# uses: coverallsapp/github-action@v2
# with:
# flag-name: ${{ matrix.package == './' && 'happy' || matrix.package }}
# parallel: true
# github-token: ${{ secrets.GITHUB_TOKEN }}
# file: ./${{ matrix.package }}/coverage.out
# finish:
# needs: test
# if: ${{ always() }}
# runs-on: ubuntu-latest
# steps:
# - name: Coveralls Finish
# uses: coverallsapp/github-action@v2
# with:
# parallel-finished: true