Skip to content

Commit 1a2db98

Browse files
Merge pull request #2110 from PowerShell/andyleejordan/github-ci
Switch to GitHub Actions for all CI
2 parents 8559105 + 9e49981 commit 1a2db98

File tree

22 files changed

+8451
-136
lines changed

22 files changed

+8451
-136
lines changed

.github/workflows/ci-test.yml

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: CI Tests
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
# The branches below must be a subset of the branches above
8+
branches: [ main ]
9+
paths-ignore: [ '**/*.md' ]
10+
merge_group:
11+
types: [ checks_requested ]
12+
13+
jobs:
14+
ci:
15+
name: dotnet
16+
strategy:
17+
matrix:
18+
os: [ windows-latest, macos-latest, ubuntu-latest ]
19+
runs-on: ${{ matrix.os }}
20+
env:
21+
DOTNET_NOLOGO: true
22+
DOTNET_CLI_TELEMETRY_OPTOUT: true
23+
DOTNET_GENERATE_ASPNET_CERTIFICATE: false
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@v4
27+
28+
- name: Install dotnet
29+
uses: actions/setup-dotnet@v4
30+
with:
31+
cache: true
32+
cache-dependency-path: '**/packages.lock.json'
33+
dotnet-version: |
34+
6.0.x
35+
7.0.x
36+
37+
- name: Install PSResources
38+
shell: pwsh
39+
run: tools/installPSResources.ps1
40+
41+
- name: Build and test
42+
shell: pwsh
43+
run: Invoke-Build
44+
45+
- name: Upload build artifacts
46+
if: always()
47+
uses: actions/upload-artifact@v3
48+
with:
49+
name: PowerShellEditorServices-module-${{ matrix.os }}
50+
path: module
51+
52+
- name: Upload test results
53+
uses: actions/upload-artifact@v3
54+
if: always()
55+
with:
56+
name: PowerShellEditorServices-test-results-${{ matrix.os }}
57+
path: '**/*.trx'

.github/workflows/codeql-analysis.yml

+20-13
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,55 @@
1-
name: Run CodeQL Analysis
1+
name: CodeQL Analysis
22

33
on:
44
push:
55
branches: [ main ]
6-
tags: [ v* ]
76
pull_request:
87
# The branches below must be a subset of the branches above
98
branches: [ main ]
109
paths-ignore: [ '**/*.md' ]
1110
merge_group:
1211
types: [ checks_requested ]
13-
schedule:
14-
- cron: '00 14 * * *' # Every morning at 7:00am PDT
1512

1613
jobs:
1714
analyze:
18-
name: Analyze
15+
name: analyze
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
language: [ csharp ]
1920
runs-on: ubuntu-latest
2021
permissions:
2122
actions: read
2223
contents: read
2324
security-events: write
24-
25-
strategy:
26-
fail-fast: false
27-
matrix:
28-
language: [ 'csharp' ]
29-
25+
env:
26+
DOTNET_NOLOGO: true
27+
DOTNET_CLI_TELEMETRY_OPTOUT: true
28+
DOTNET_GENERATE_ASPNET_CERTIFICATE: false
3029
steps:
3130
- name: Checkout repository
3231
uses: actions/checkout@v4
3332

3433
- name: Install dotnet
3534
uses: actions/setup-dotnet@v4
35+
with:
36+
cache: true
37+
cache-dependency-path: '**/packages.lock.json'
3638

37-
# Initializes the CodeQL tools for scanning.
3839
- name: Initialize CodeQL
3940
uses: github/codeql-action/init@v2
4041
with:
4142
languages: ${{ matrix.language }}
4243

44+
- name: Install PSResources
45+
shell: pwsh
46+
run: tools/installPSResources.ps1
47+
4348
- name: Build
4449
shell: pwsh
45-
run: tools/azurePipelinesBuild.ps1
50+
run: Invoke-Build Build
4651

4752
- name: Perform CodeQL Analysis
4853
uses: github/codeql-action/analyze@v2
54+
with:
55+
category: '/language:${{matrix.language}}'

.github/workflows/emacs-test.yml

+15-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ name: Emacs End-to-End Tests
33
on:
44
push:
55
branches: [ main ]
6-
tags: [ v* ]
76
pull_request:
87
# The branches below must be a subset of the branches above
98
branches: [ main ]
@@ -12,19 +11,30 @@ on:
1211
types: [ checks_requested ]
1312

1413
jobs:
15-
test:
16-
name: Test via Eglot
14+
emacs:
15+
name: ert
1716
runs-on: ubuntu-latest
17+
env:
18+
DOTNET_NOLOGO: true
19+
DOTNET_CLI_TELEMETRY_OPTOUT: true
20+
DOTNET_GENERATE_ASPNET_CERTIFICATE: false
1821
steps:
1922
- name: Checkout repository
2023
uses: actions/checkout@v4
2124

2225
- name: Install dotnet
2326
uses: actions/setup-dotnet@v4
27+
with:
28+
cache: true
29+
cache-dependency-path: '**/packages.lock.json'
30+
31+
- name: Install PSResources
32+
shell: pwsh
33+
run: tools/installPSResources.ps1
2434

25-
- name: Build PSES
35+
- name: Build
2636
shell: pwsh
27-
run: tools/azurePipelinesBuild.ps1
37+
run: Invoke-Build Build
2838

2939
- name: Install Emacs
3040
uses: purcell/setup-emacs@master

.github/workflows/vim-test.yml

+15-6
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ name: Vim End-to-End Tests
33
on:
44
push:
55
branches: [ main ]
6-
tags: [ v* ]
76
pull_request:
87
# The branches below must be a subset of the branches above
98
branches: [ main ]
@@ -12,23 +11,33 @@ on:
1211
types: [ checks_requested ]
1312

1413
jobs:
15-
test:
16-
name: Test via LanguageClient-neovim
14+
vim:
15+
name: themis
1716
runs-on: ubuntu-latest
17+
env:
18+
DOTNET_NOLOGO: true
19+
DOTNET_CLI_TELEMETRY_OPTOUT: true
20+
DOTNET_GENERATE_ASPNET_CERTIFICATE: false
1821
steps:
1922
- name: Checkout repository
2023
uses: actions/checkout@v4
2124

2225
- name: Install dotnet
2326
uses: actions/setup-dotnet@v4
27+
with:
28+
cache: true
29+
cache-dependency-path: '**/packages.lock.json'
30+
31+
- name: Install PSResources
32+
shell: pwsh
33+
run: tools/installPSResources.ps1
2434

25-
- name: Build PSES
35+
- name: Build
2636
shell: pwsh
27-
run: tools/azurePipelinesBuild.ps1
37+
run: Invoke-Build Build
2838

2939
- name: Install Vim
3040
uses: rhysd/action-setup-vim@v1
31-
id: vim
3241

3342
- name: Checkout vim-ps1
3443
uses: actions/checkout@v4

.vsts-ci/azure-pipelines-ci.yml

+11-26
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,33 @@
11
name: CI-$(Build.SourceBranchName)-$(Date:yyyyMMdd)$(Rev:.rr)
22

3+
pr: none
4+
35
trigger:
4-
- gh-readonly-queue/main/*
5-
pr:
6-
paths:
7-
exclude:
8-
- '**/*.md'
6+
branches:
7+
include:
8+
- release
99

1010
variables:
1111
# Don't download unneeded packages
12-
- name: DOTNET_SKIP_FIRST_TIME_EXPERIENCE
12+
- name: DOTNET_NOLOGO
1313
value: 'true'
1414
# Improve performance by not sending telemetry
1515
- name: DOTNET_CLI_TELEMETRY_OPTOUT
1616
value: 'true'
17+
# Improve performance by not generating certificates
18+
- name: DOTNET_GENERATE_ASPNET_CERTIFICATE
19+
value: 'false'
1720

1821
jobs:
1922
- job: windows2022
20-
displayName: Windows 2022 PowerShell 5.1
21-
pool:
22-
vmImage: windows-2022
23-
steps:
24-
- template: templates/ci-general.yml
25-
parameters:
26-
pwsh: false
27-
28-
- job: windows2022pwsh
29-
displayName: Windows 2022 PowerShell 7
23+
displayName: Windows 2022
3024
pool:
3125
vmImage: windows-2022
3226
steps:
3327
- template: templates/ci-general.yml
3428

3529
- job: windows2019
36-
displayName: Windows 2019 PowerShell 5.1
37-
pool:
38-
vmImage: windows-2019
39-
steps:
40-
- template: templates/ci-general.yml
41-
parameters:
42-
pwsh: false
43-
44-
- job: windows2019pwsh
45-
displayName: Windows 2019 PowerShell 7
30+
displayName: Windows 2019
4631
pool:
4732
vmImage: windows-2019
4833
steps:

.vsts-ci/azure-pipelines-release.yml

+11-6
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
11
name: Release-$(Build.SourceBranchName)-$(Date:yyyyMMdd)$(Rev:.rr)
22

3+
pr: none
4+
5+
trigger:
6+
branches:
7+
include:
8+
- release
9+
310
variables:
411
# Don't download unneeded packages
5-
- name: DOTNET_SKIP_FIRST_TIME_EXPERIENCE
12+
- name: DOTNET_NOLOGO
613
value: 'true'
714
# Improve performance by not sending telemetry
815
- name: DOTNET_CLI_TELEMETRY_OPTOUT
916
value: 'true'
10-
11-
trigger:
12-
branches:
13-
include:
14-
- release
17+
# Improve performance by not generating certificates
18+
- name: DOTNET_GENERATE_ASPNET_CERTIFICATE
19+
value: 'false'
1520

1621
resources:
1722
repositories:

.vsts-ci/templates/ci-general.yml

+12-10
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
1-
parameters:
2-
- name: pwsh
3-
type: boolean
4-
default: true
5-
61
steps:
72
- task: PowerShell@2
83
displayName: PowerShell version
94
inputs:
105
targetType: inline
6+
pwsh: true
117
script: $PSVersionTable
12-
pwsh: ${{ parameters.pwsh }}
138

149
- task: UseDotNet@2
1510
displayName: Install .NET 7.0.x SDK
@@ -25,18 +20,25 @@ steps:
2520
version: 6.0.x
2621
performMultiLevelLookup: true
2722

23+
- task: PowerShell@2
24+
displayName: Install PSResources
25+
inputs:
26+
pwsh: true
27+
filePath: tools/installPSResources.ps1
28+
2829
- task: PowerShell@2
2930
displayName: Build
3031
inputs:
31-
filePath: tools/azurePipelinesBuild.ps1
32-
pwsh: ${{ parameters.pwsh }}
32+
targetType: inline
33+
pwsh: true
34+
script: Invoke-Build Build -Configuration Release
3335

3436
- task: PowerShell@2
3537
displayName: Test
3638
inputs:
3739
targetType: inline
40+
pwsh: true
3841
script: Invoke-Build Test -Configuration Release
39-
pwsh: ${{ parameters.pwsh }}
4042

4143
- task: PublishTestResults@2
4244
displayName: Publish test results
@@ -49,13 +51,13 @@ steps:
4951
displayName: Assert PowerShellEditorServices release configuration
5052
inputs:
5153
targetType: inline
54+
pwsh: true
5255
script: |
5356
$assembly = [Reflection.Assembly]::LoadFile("$(Build.SourcesDirectory)/module/PowerShellEditorServices.VSCode/bin/Microsoft.PowerShell.EditorServices.VSCode.dll")
5457
if ($assembly.GetCustomAttributes([System.Diagnostics.DebuggableAttribute], $true).IsJITOptimizerDisabled) {
5558
Write-Host "##vso[task.LogIssue type=error;] PowerShell Editor Services bits were not built in release configuration!"
5659
exit 1
5760
}
58-
pwsh: ${{ parameters.pwsh }}
5961
6062
# NOTE: We zip the artifacts because they're ~20 MB compressed, but ~300 MB raw,
6163
# and we have limited pipeline artifact storage space.

PowerShellEditorServices.Common.props

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
<RepositoryType>git</RepositoryType>
1212
<RepositoryUrl>https://github.com/PowerShell/PowerShellEditorServices</RepositoryUrl>
1313
<DebugType>portable</DebugType>
14+
<!-- See https://learn.microsoft.com/en-us/nuget/consume-packages/package-references-in-project-files#locking-dependencies -->
15+
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
1416
<!-- See: https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/overview -->
1517
<EnableNETAnalyzers>true</EnableNETAnalyzers>
1618
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>

0 commit comments

Comments
 (0)