-
Notifications
You must be signed in to change notification settings - Fork 2
67 lines (57 loc) · 1.76 KB
/
test-sample-codes.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
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Test Code Samples
on:
pull_request:
schedule:
- cron: '0 23 * * *'
# Allows to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
test:
name: Run tests
timeout-minutes: 30
strategy:
max-parallel: 2
matrix:
os:
- "ubuntu-22.04"
dotnet-version:
- "net6.0"
- "net7.0"
- "net8.0"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
8.0.x
# - uses: actions/cache@v4
# with:
# path: ~/.nuget/packages
# key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
# restore-keys: |
# ${{ runner.os }}-nuget-
- name: Install dotnet-script
run: |
dotnet tool install -g dotnet-script
- name: Create local NuGet source
run: |
mkdir "${{ github.workspace }}/nuget_local"
dotnet nuget add source "${{ github.workspace }}/nuget_local" -n "NugetLocal"
- name: Set the Version
run: |
VERSION=99.99.99
sed -i "s/<VersionPrefix>[0-9.]*<\/VersionPrefix>/<VersionPrefix>$VERSION<\/VersionPrefix>/g" Directory.Build.props
sed -i "s/\*-\*/$VERSION/g" docs/code_samples/base.csx
- name: Publish Locally
run: |
dotnet pack "src/Mindee" -p:TargetFrameworks=${{ matrix.dotnet-version }} --output ./dist
cd ./dist
dotnet nuget push *.nupkg --source "NugetLocal"
- name: Tests sample code
run: |
./tests/test_code_samples.sh ${{ secrets.MINDEE_ACCOUNT_SE_TESTS }} ${{ secrets.MINDEE_ENDPOINT_SE_TESTS }} ${{ secrets.MINDEE_API_KEY_SE_TESTS }}