Bump Microsoft.CodeAnalysis.CSharp.Workspaces and Microsoft.CodeAnalysis.CSharp in /ImmutableAnalyzer/ImmutableAnalyzer #53
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ "master" ] | |
paths-ignore: | |
- '.github/**' | |
- 'doc/**' | |
pull_request: | |
branches: [ "master" ] | |
paths-ignore: | |
- '.github/**' | |
- 'doc/**' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v2 | |
- name: setup .NET | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: 6.0.x | |
- name: restore | |
run: dotnet restore | |
- name: test | |
run: dotnet test --logger "trx;LogFileName=test-results.trx" || true | |
- name: create test report | |
uses: dorny/test-reporter@v1 | |
id: test_report | |
if: always() | |
with: | |
name: Tests | |
path: "**/test-results.trx" | |
reporter: dotnet-trx | |
fail-on-error: true | |
- name: update test badge in README.md | |
run: | | |
echo "Adding test report to README.md file..." | |
test_report_url=$(echo ${{ toJson(steps.test_report.outputs.url_html) }} | sed 's/\//\\\//g') | |
workflow_file=$(echo ${{ github.workflow_ref }} | sed 's/.*\/\(.*\)@.*/\1/') | |
badge_url=$(echo "${{ github.server_url }}/${{ github.repository }}/actions/workflows/$workflow_file/badge.svg" | sed 's/\//\\\//g') | |
echo "Badge URL: ${{ github.server_url }}/${{ github.repository }}/actions/workflows/$workflow_file/badge.svg" | |
echo "Report URL: ${{ toJson(steps.test_report.outputs.url_html) }}" | |
sed -i '2s/.*/[![${{ github.workflow }}]('"$badge_url"')]('"$test_report_url"')/' README.md | |
- name: commit changes | |
uses: EndBug/add-and-commit@v9 | |
if: github.ref == 'refs/heads/master' && github.event_name == 'push' | |
with: | |
add: README.md | |
message: 'update test badge in README.md' | |
default_author: github_actions | |
fetch: false |