-
Notifications
You must be signed in to change notification settings - Fork 1
54 lines (45 loc) · 1.82 KB
/
testcleanup.yml
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
54
name: Test CleanUp
on:
workflow_run:
workflows: [ Build ]
branches: [ main, dev ]
types: [ completed ]
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-20.04 ]
dotnet-version: [ '3.1.x' ]
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Dotnet Version (${{ matrix.dotnet-version }})
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Find And Replace Values (App Config)
uses: abhinavminhas/replace-tokens@main
with:
files: '${{ github.workspace }}/GmailAPIHelper.CORE.Tests/App.config'
replacements: '__GMAILID__=${{ secrets.GMAIL_ID }}'
- name: Build
run: dotnet build GmailAPIHelper.CORE.Tests/GmailAPIHelper.CORE.Tests.csproj --configuration Release
- name: Find And Replace Values (OAuth)
if: ${{ matrix.dotnet-version == '3.1.x' }}
uses: abhinavminhas/replace-tokens@main
with:
files: '${{ github.workspace }}/GmailAPIHelper.CORE.Tests/bin/Release/netcoreapp3.1/token.json/Google.Apis.Auth.OAuth2.Responses.TokenResponse-user'
replacements: '__ACCESSTOKEN__=${{ secrets.ACCESS_TOKEN }}'
- name: Find And Replace Values (Client Secret)
if: ${{ matrix.dotnet-version == '3.1.x' }}
uses: abhinavminhas/replace-tokens@main
with:
files: '${{ github.workspace }}/GmailAPIHelper.CORE.Tests/bin/Release/netcoreapp3.1/credentials.json'
replacements: '__CLIENTSECRET__=${{ secrets.CLIENT_SECRET }}'
- name: Test CleanUp
if: ${{ matrix.dotnet-version == '3.1.x' }}
run: dotnet test --no-build --verbosity normal --configuration Release --filter TestCategory=TestCleanup