Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add gocover checks for PR's #74

Merged
merged 41 commits into from
Jul 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
037bd2f
updat github rest name
hsubramanianaks Jul 26, 2023
1e5fd2d
download asset url and run go cover
hsubramanianaks Jul 26, 2023
cd66fd7
correct result-encoding
hsubramanianaks Jul 26, 2023
a05df0a
change it to steps
hsubramanianaks Jul 26, 2023
090d555
try with bash and wget
hsubramanianaks Jul 26, 2023
2636d1f
add echo statement to verify asset url
hsubramanianaks Jul 26, 2023
cfd604e
remove trim from asset url
hsubramanianaks Jul 26, 2023
ecdb5fa
try as json result encoding
hsubramanianaks Jul 26, 2023
8521041
change the js filter condition
hsubramanianaks Jul 26, 2023
4386f27
correct the cover profile syntax err
hsubramanianaks Jul 26, 2023
965b8e7
Go cover (#1)
hsubramanianaks Jul 26, 2023
0aa9794
Go cover (#2)
hsubramanianaks Jul 26, 2023
bf69c83
Merge branch 'main' of github.com:hsubramanianaks/aks-app-routing-ope…
hsubramanianaks Jul 26, 2023
f47f79c
upload coverage html report
hsubramanianaks Jul 27, 2023
b532e39
upload artifact to v3
hsubramanianaks Jul 27, 2023
d22ec6f
bumping setup go action to remove deprecated warnings
hsubramanianaks Jul 27, 2023
c8b161d
change coverage report name
hsubramanianaks Jul 27, 2023
6d33196
change it back to workflow call and separate jobs
hsubramanianaks Jul 27, 2023
218a99d
try with id-token write for e2e
hsubramanianaks Jul 27, 2023
1eeb92a
remove dependson from unit test
hsubramanianaks Jul 27, 2023
0e1cb8a
update gocover full to diff check
hsubramanianaks Jul 27, 2023
810e989
add checkout and setup go step.
hsubramanianaks Jul 27, 2023
79ffb4a
correct syntax error
hsubramanianaks Jul 27, 2023
0e77f36
change compare branch to HEAD~1
hsubramanianaks Jul 27, 2023
868f85a
try with main branch
hsubramanianaks Jul 27, 2023
9626fd7
add echo statements to triage failure
hsubramanianaks Jul 27, 2023
ee5d76e
checkout without ref
hsubramanianaks Jul 27, 2023
699cdb1
try with github event before
hsubramanianaks Jul 28, 2023
4df71cb
put back the with ref input
hsubramanianaks Jul 28, 2023
d3f8ee6
try with exact commit hash
hsubramanianaks Jul 28, 2023
77b5a73
remove git ls
hsubramanianaks Jul 28, 2023
abceb65
tyr with branch name
hsubramanianaks Jul 28, 2023
21d375c
run git fetch and run gocover
hsubramanianaks Jul 28, 2023
3d11b9a
making the percentage 80
hsubramanianaks Jul 28, 2023
64d287a
change unit test to on pull request
hsubramanianaks Jul 28, 2023
03e5039
remove depends on
hsubramanianaks Jul 28, 2023
9c48d12
remove ref and ensure ref check
hsubramanianaks Jul 28, 2023
288002f
add coverall to unit tst
hsubramanianaks Jul 28, 2023
22e47d3
update to sha commits and remove unit from pr validate fork
hsubramanianaks Jul 28, 2023
e4338bb
remove unit tests from pr validate workflow
hsubramanianaks Jul 28, 2023
d6f1eb5
Add badge to README
hsubramanianaks Jul 28, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions .github/workflows/pr-validate-fork.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,21 +50,11 @@ jobs:
ref: 'refs/pull/${{ github.event.client_payload.pull_request.number }}/merge'
skipRefCheck: false
secrets: inherit
unit:
needs: setup
if:
github.event_name == 'repository_dispatch' &&
github.event.client_payload.slash_command.args.named.sha != '' &&
contains(github.event.client_payload.pull_request.head.sha, github.event.client_payload.slash_command.args.named.sha)
uses: ./.github/workflows/unit.yaml
with:
ref: 'refs/pull/${{ github.event.client_payload.pull_request.number }}/merge'
skipRefCheck: false
status:
permissions:
checks: write
pull-requests: read
needs: [e2e, unit]
needs: [e2e]
runs-on: ubuntu-latest
if: ${{ always() }}
steps:
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/pr-validate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,11 @@ jobs:
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
uses: ./.github/workflows/e2e.yaml
secrets: inherit
unit:
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
uses: ./.github/workflows/unit.yaml
status:
permissions:
checks: write
pull-requests: read
needs: [e2e, unit]
needs: [e2e]
runs-on: ubuntu-latest
steps:
- name: Update status
Expand Down
34 changes: 14 additions & 20 deletions .github/workflows/unit.yaml
Original file line number Diff line number Diff line change
@@ -1,37 +1,31 @@
name: Unit Tests

on:
workflow_call:
inputs:
ref:
type: string
skipRefCheck:
type: boolean
default: true
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
unit-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ inputs.ref }}

- name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@v3
hsubramanianaks marked this conversation as resolved.
Show resolved Hide resolved
with:
go-version: ~1.20.0

- name: Run Unit Tests
if:
(github.event_name == 'repository_dispatch' &&
github.event.client_payload.slash_command.args.named.sha != '' &&
contains(github.event.client_payload.pull_request.head.sha, github.event.client_payload.slash_command.args.named.sha)) ||
inputs.skipRefCheck
run: go test -race -v ./...
run: go test -race -v ./... -coverprofile=coverage.out

- name: Convert coverage to lcov
uses: jandelgado/gcov2lcov-action@c680c0f7c7442485f1749eb2a13e54a686e76eb5 #v1.0.8

- name: Ensure ref
uses: actions/github-script@v6
if: ${{ !((github.event_name == 'repository_dispatch' && github.event.client_payload.slash_command.args.named.sha != '' && contains(github.event.client_payload.pull_request.head.sha, github.event.client_payload.slash_command.args.named.sha)) || inputs.skipRefCheck) }}
- name: Coveralls
uses: coverallsapp/github-action@95b1a2355bd0e526ad2fd62da9fd386ad4c98474 #v2.2.1
with:
script: core.setFailed('Ref is not latest')
flag-name: unit-test
path-to-lcov: coverage.lcov

2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# AKS Web Application Routing Operator

[![Coverage Status](https://coveralls.io/repos/github/Azure/aks-app-routing-operator/badge.svg?branch=main)](https://coveralls.io/github/Azure/aks-app-routing-operator?branch=main)

A Kubernetes operator that manages resources related to AKS Application Routing functionality.

## Docs
Expand Down