-
Notifications
You must be signed in to change notification settings - Fork 67
58 lines (54 loc) · 1.83 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
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
lint:
runs-on: windows-2019
steps:
- name: Checkout code
uses: actions/checkout@v3
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@v3
- name: Get changed files
id: files
uses: Ana06/[email protected]
with:
filter: '*.nuspec'
- name: Build and test all modified packages
id: test
# It runs only if there are modified files
if: steps.files.outputs.added_modified_renamed != ''
run: |
$packages = "${{ steps.files.outputs.added_modified_renamed }}".Split(" ") | Foreach-Object { (Get-Item $_).Directory.Name }
scripts/test/test_install.ps1 "common.vm $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-2019'
run: |
$built_pkgs = Get-ChildItem built_pkgs
Set-Location built_pkgs
foreach ($package in $built_pkgs) {
cpush -s "https://www.myget.org/F/vm-packages/api/v2" -k ${{ secrets.MYGET_TOKEN }} $package
}