Merge pull request #32 from aserto-dev/instance_label #261
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: ci | |
on: | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
- v* | |
# Publish `v1.2.3` tags as releases. | |
tags: | |
- v* | |
# Run tests for PRs | |
pull_request: | |
env: | |
VAULT_ADDR: https://vault.eng.aserto.com/ | |
jobs: | |
build: | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
cfg: | |
- { project: Aserto.AspNetCore.Middleware, dotnet: 7.x} | |
name: Build ${{ matrix.cfg.project }} on ${{ matrix.cfg.dotnet }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup dotnet | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: ${{ matrix.cfg.dotnet }} | |
- name: Build ${{ matrix.cfg.project }} | |
run: | | |
dotnet build src/${{ matrix.cfg.project }} | |
test: | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
cfg: | |
- { project: Aserto.AspNetCore.Middleware.Tests } | |
name: Test ${{ matrix.cfg.project }} test. | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup dotnet 7.x | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: 7.x | |
- name: Setup dotnet 3.1.x | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: 3.1.x | |
- name: Test Aserto.AspNetCore.Middleware | |
run: | | |
dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=lcov /p:CoverletOutput=./lcov.info tests/${{ matrix.cfg.project }} | |
- name: Coveralls | |
continue-on-error: true | |
uses: coverallsapp/github-action@master | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
path-to-lcov: tests\${{ matrix.cfg.project }}\lcov.net7.info | |
release: | |
runs-on: ubuntu-latest | |
needs: test | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
steps: | |
- name: Read Configuration | |
uses: hashicorp/[email protected] | |
id: vault | |
with: | |
url: ${{ env.VAULT_ADDR }} | |
token: ${{ secrets.VAULT_TOKEN }} | |
secrets: | | |
kv/data/nuget "NUGET_API_KEY" | NUGET_API_KEY; | |
- uses: actions/checkout@v2 | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: 7.x | |
- name: Build | |
run: dotnet build --configuration Release src/Aserto.AspNetCore.Middleware/Aserto.AspNetCore.Middleware.csproj | |
- name: Publish to NuGet.org | |
run: | | |
dotnet nuget push ./src/Aserto.AspNetCore.Middleware/bin/Release/*.nupkg --api-key ${NUGET_API_KEY} --source https://api.nuget.org/v3/index.json |