-
Notifications
You must be signed in to change notification settings - Fork 196
53 lines (45 loc) · 2.05 KB
/
run_publisher_tests.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Run publisher integration tests
on:
workflow_dispatch:
jobs:
run_tests:
name: Run tests
runs-on: ubuntu-latest
environment: dev
permissions:
id-token: write
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.x
- name: Login to Azure
uses: azure/login@v1
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
enable-AzPSSession: true
- name: Run tests
uses: azure/powershell@v1
with:
inlineScript: |
Set-StrictMode -Version Latest
$ErrorActionPreference = "Stop"
$VerbosePreference = "Continue"
$InformationPreference = "Continue"
$env:PUBLISHER_ARTIFACTS_PATH = Join-Path "${{ github.workspace }}" "tools" "code" "publisher.integration.tests" "test-artifacts"
$env:EXTRACTOR_ARTIFACTS_PATH = Join-Path "${{ runner.temp }}" "extractor artifacts"
$env:PUBLISHER_PROJECT_PATH = Join-Path "${{ github.workspace }}" "tools" "code" "publisher" "publisher.csproj"
$env:EXTRACTOR_PROJECT_PATH = Join-Path "${{ github.workspace }}" "tools" "code" "extractor" "extractor.csproj"
$env:AZURE_BEARER_TOKEN = (Get-AzAccessToken).Token
$env:AZURE_CLOUD_ENVIRONMENT = "AzurePublicCloud"
$env:AZURE_API_MANAGEMENT_SERVICE_NAME = "apiops-$((New-Guid).Guid.Substring(0, 10))"
$env:AZURE_RESOURCE_GROUP_NAME = "${{ secrets.AZURE_RESOURCE_GROUP_NAME }}"
$testProjectPath = Join-Path "${{ github.workspace }}" "tools" "code" "publisher.integration.tests" "publisher.integration.tests.csproj"
& dotnet test "$testProjectPath" --logger "console;verbosity=detailed"
if ($LASTEXITCODE -ne 0) { throw "Running test failed."}
azPSVersion: "latest"