-
Notifications
You must be signed in to change notification settings - Fork 765
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
[repo] CI improvements #5023
[repo] CI improvements #5023
Changes from all commits
e19c474
0e02a27
4efbae7
6b4532a
5ddb458
4300138
600313e
79816af
31b789c
d776b6d
2db4dad
112ce8a
850f630
5f26201
76d73ad
67f5bae
6f2305b
9e51290
75dfdbc
ed0d044
be20741
c37d22f
7d55fb9
4f5870b
29d9b86
df4b76b
451e379
13ec712
60768c5
951b2a7
2f809cd
e1c9d0b
e6ee01b
e1d00ad
5b3418e
5d700b9
1549535
c8a78fc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,32 @@ comment: | |
require_changes: no | ||
|
||
ignore: | ||
- "docs/**/*" | ||
- "examples/**/*" | ||
- "test/**/*" | ||
- "**.md" | ||
- ".github" | ||
- ".vscode" | ||
- "build" | ||
- "docs" | ||
- "examples" | ||
- "src/Shared" | ||
- "test" | ||
|
||
flags: | ||
unittests-Solution-Stable: | ||
carryforward: true | ||
paths: | ||
- src | ||
|
||
unittests-Solution-Experimental: | ||
carryforward: true | ||
paths: | ||
- src | ||
|
||
unittests-Instrumentation-Stable: | ||
carryforward: true | ||
paths: | ||
- src | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Update path for instrumentation? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure on this either. InstrumentationLibraries.proj actually builds and tests everything so this should be fine but 🤷 I'm considering code coverage as a WIP! |
||
|
||
unittests-Instrumentation-Experimental: | ||
carryforward: true | ||
paths: | ||
- src |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
# Called by ci.yml to build & test project files | ||
# See: https://docs.github.com/en/actions/using-workflows/reusing-workflows#creating-a-reusable-workflow | ||
name: Build Component | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
project-name: | ||
required: true | ||
type: string | ||
project-build-commands: | ||
default: '' | ||
required: false | ||
type: string | ||
code-cov-name: | ||
required: true | ||
type: string | ||
code-cov-prefix: | ||
default: 'unittests' | ||
required: false | ||
type: string | ||
os-list: | ||
default: '[ "windows-latest", "ubuntu-latest" ]' | ||
required: false | ||
type: string | ||
tfm-list: | ||
default: '[ "net462", "net6.0", "net7.0", "net8.0" ]' | ||
required: false | ||
type: string | ||
|
||
jobs: | ||
build-test: | ||
|
||
strategy: | ||
fail-fast: false # ensures the entire test matrix is run, even if one permutation fails | ||
matrix: | ||
os: ${{ fromJSON(inputs.os-list) }} | ||
version: ${{ fromJSON(inputs.tfm-list) }} | ||
exclude: | ||
- os: ubuntu-latest | ||
version: net462 | ||
|
||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
# Note: By default GitHub only fetches 1 commit. MinVer needs to find | ||
# the version tag which is typically NOT on the first commit so we | ||
# retrieve them all. | ||
fetch-depth: 0 | ||
|
||
- name: Setup dotnet | ||
uses: actions/setup-dotnet@v4 | ||
|
||
- name: dotnet restore ${{ inputs.project-name }} | ||
run: dotnet restore ${{ inputs.project-name }} ${{ inputs.project-build-commands }} | ||
|
||
- name: dotnet build ${{ inputs.project-name }} | ||
run: dotnet build ${{ inputs.project-name }} --configuration Release --no-restore ${{ inputs.project-build-commands }} | ||
|
||
- name: dotnet test ${{ inputs.project-name }} | ||
run: dotnet test ${{ inputs.project-name }} --collect:"Code Coverage" --results-directory:TestResults --framework ${{ matrix.version }} --configuration Release --no-restore --no-build --logger:"console;verbosity=detailed" -- RunConfiguration.DisableAppDomain=true | ||
|
||
- name: Install coverage tool | ||
run: dotnet tool install -g dotnet-coverage | ||
|
||
- name: Merging test results | ||
run: dotnet-coverage merge -r -f cobertura -o ./TestResults/Cobertura.xml ./TestResults/*.coverage | ||
|
||
- name: Upload code coverage ${{ inputs.code-cov-prefix }}-${{ inputs.code-cov-name }} | ||
uses: codecov/codecov-action@v3.1.4 | ||
continue-on-error: true # Note: Don't fail for upload failures | ||
env: | ||
OS: ${{ matrix.os }} | ||
TFM: ${{ matrix.version }} | ||
with: | ||
file: TestResults/Cobertura.xml | ||
env_vars: OS,TFM | ||
flags: ${{ inputs.code-cov-prefix }}-${{ inputs.code-cov-name }} | ||
name: Code Coverage for ${{ inputs.code-cov-prefix }}-${{ inputs.code-cov-name }} on [${{ matrix.os }}.${{ matrix.version }}] |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should shared files under
src
be excluded?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. This was copied from contrib but probably shouldn't be here. I'm thinking I'm going to leave it alone to see how codecov handles the new ci and come back to this later to smooth out any rough edges. I haven't figured out a way to make codecov really useful yet on contrib either 🤣