Skip to content

Release 1.0.0 (#38) #75

Release 1.0.0 (#38)

Release 1.0.0 (#38) #75

Workflow file for this run

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: Download samples
working-directory: src
run: powershell .\DownloadSamples.ps1
- 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