-
Notifications
You must be signed in to change notification settings - Fork 1.2k
64 lines (56 loc) · 2.3 KB
/
windows-unittests.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
name: "Windows unit tests"
on:
push:
branches:
- main
- 7.[0-9][0-9].x
- mq-working-branch-*
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
windows-unit-tests:
runs-on: windows-2022 # https://github.com/actions/virtual-environments/blob/main/images/win/Windows2019-Readme.md
steps:
- name: Checkout datadog-agent repository
uses: actions/checkout@v3
with:
fetch-depth: 0 #needed for 'git describe' to work
- name: Install python
uses: actions/setup-python@v4
with:
python-version: "3.9.5"
cache: "pip"
- run: |
python -m pip install -r requirements.txt
If ($lastExitCode -ne "0") { throw "Previous command returned $lastExitCode" }
- name: Install go
uses: actions/setup-go@v3
with:
go-version-file: ".go-version"
- name: Set up runner
run: |
$ErrorActionPreference = 'Stop';
# install dependencies
inv -e install-tools
If ($lastExitCode -ne "0") { throw "Previous command returned $lastExitCode" }
inv -e deps
If ($lastExitCode -ne "0") { throw "Previous command returned $lastExitCode" }
# create 'ddagentuser' user to test the secrets feature on windows
$Password = ConvertTo-SecureString "dummyPW_:-gch6Rejae9" -AsPlainText -Force
New-LocalUser -Name "ddagentuser" -Description "Test user for the secrets feature on windows." -Password $Password
- name: Run tests
shell: bash # using bash so we don't have to check $lastExitCode all the time
run: |
export PATH="/c/msys64/mingw64/bin:/c/msys64/usr/bin/:$PATH" # prepend msys, otherwise make from mingw gets used
echo $PATH
powershell.exe -Command ./tasks/winbuildscripts/pre-go-build.ps1
# FIXME: skipping rtloader tests because they fail with a DLL-not-found error
# inv -e rtloader.test
inv -e test --rerun-fails=2 --python-runtimes 3 --coverage --profile --python-home-3=$pythonLocation --timeout=600
- name: Upload Codecov results
uses: codecov/codecov-action@v3
with:
flags: windows
name: codecov-windows