Release 1.0.1 (#41) #81
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: Test | |
on: | |
pull_request: | |
branches: | |
- main | |
types: [opened, synchronize, reopened, edited] | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
name: Test | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install Net 6 | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: '6.0.201' | |
- name: Install Net 5 | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: '5.0.202' | |
- name: Display repository name | |
env: | |
REPOSITORY: ${{ github.repository }} | |
run: | | |
Write-Host "The repository is: ${env:REPOSITORY}" | |
- name: Install coveralls.net (to send test coverage) | |
if: github.repository == 'aas-core-works/aas-package3-csharp' && github.event_name == 'push' && github.ref == 'refs/heads/main' | |
working-directory: src | |
run: dotnet tool install coveralls.net --version 2.0.0-beta0002 | |
- name: Run tests | |
working-directory: src | |
run: powershell .\Test.ps1 | |
- name: Send to Coveralls | |
if: github.repository == 'aas-core-works/aas-package3-csharp' && github.event_name == 'push' && github.ref == 'refs/heads/main' | |
working-directory: src | |
env: | |
HEAD_REF: ${{ github.head_ref }} | |
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} | |
run: | | |
# At the moment we only run coveralls on main. | |
# However, we leave this legacy logic here in case we introduce | |
# new branching policy or new coverage publishing rules. | |
if (${env:GITHUB_REF}.StartsWith("refs/pull/")) | |
{ | |
$branch = ${env:HEAD_REF} -Replace 'refs/heads/', '' | |
} | |
else | |
{ | |
$branch = ${env:GITHUB_REF} -Replace 'refs/heads/', '' | |
} | |
$commit = $env:GITHUB_SHA | |
echo "Branch is: $branch" | |
echo "Commit is: $commit" | |
dotnet tool run csmacnz.Coveralls --opencover -i AasCore.Aas3.Package.Tests\coverage.net6.0.opencover.xml --useRelativePaths --repoToken $env:COVERALLS_REPO_TOKEN --commitId $commit --commitBranch $branch |