-
Notifications
You must be signed in to change notification settings - Fork 64
65 lines (61 loc) · 2.41 KB
/
ci.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
name: Test & Push
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
lint:
runs-on: windows-2019
steps:
- name: Checkout code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
# fetch all history for all branches
fetch-depth: 0
- name: Run lint.py
run: python scripts/test/lint.py packages
- name: Run lint.ps1
run: scripts/test/lint.ps1
test_upload:
runs-on: ${{ matrix.os }}
needs: [lint]
strategy:
fail-fast: false
matrix:
os: [windows-2019, windows-2022]
steps:
- name: Checkout code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Get changed files
id: files
uses: Ana06/get-changed-files@25f79e676e7ea1868813e21465014798211fad8c # v2.3.0
with:
filter: '*.nuspec'
- name: Build and test all modified packages
id: test
# It runs only if there are modified files
# We specifically test for "microsoft-windows-terminal.vm" in 'windows-2019' because it requires at least Windows 10 version 1903/OS build 18362
if: steps.files.outputs.added_modified_renamed != ''
run: |
$os = "${{ matrix.os }}"
$packages = "${{ steps.files.outputs.added_modified_renamed }}".Split(" ") | Foreach-Object { (Get-Item $_).Directory.Name }
if ($os -eq 'windows-2019') {
$excludedPackages = @("microsoft-windows-terminal.vm")
$packages = $packages | Where-Object { $_ -notin $excludedPackages }
}
$packages = ("common.vm " + $packages -join " ").Trim()
scripts/test/test_install.ps1 "$packages"
- name: Upload logs to artifacts
uses: ./.github/actions/upload-logs
if: always()
- name: Push all built packages to MyGet
# Only push packages on master if they were built (not if testing was skipped) and
# only with one version of Windows (otherwise it would be pushed 3 times)
if: steps.test.outcome == 'success' && github.event_name == 'push' && matrix.os == 'windows-2022'
run: |
$built_pkgs = Get-ChildItem built_pkgs
Set-Location built_pkgs
foreach ($package in $built_pkgs) {
choco push -s "https://www.myget.org/F/vm-packages/api/v2" -k ${{ secrets.MYGET_TOKEN }} $package
}