-
Notifications
You must be signed in to change notification settings - Fork 5
74 lines (74 loc) · 2.69 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
66
67
68
69
70
71
72
73
74
name: CI
on:
push:
branches-ignore:
- main
paths-ignore:
- .github/**
- README.md
- .all-contributorsrc
- CHANGELOG.md
- LICENSE
workflow_dispatch:
jobs:
Test:
runs-on: ${{ matrix.os }}
defaults:
run:
shell: pwsh
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Set Variables
run: |
"BUILD_NUMBER=$(Get-Date -UFormat %s -Millisecond 0)" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf-8 -Append
"BARE_REPOSITORY=$($env:GITHUB_REPOSITORY.split("/")[1])" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf-8 -Append
"RUNNER_OS_LOWER=$($env:RUNNER_OS.ToLower())" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf-8 -Append
- name: Checkout
uses: actions/checkout@v3
- name: Update Metadata
uses: natescherer/update-powershell-metadata-action@v2
with:
path: test/library/TestModule-${{ env.RUNNER_OS_LOWER }}/TestModule-${{ env.RUNNER_OS_LOWER }}.psd1
version: 1.0.1-alpha${{ env.BUILD_NUMBER }}
- name: Publish to Packages
uses: ./
with:
token: ${{ secrets.GITHUB_TOKEN }}
target: packages
path: tests/library/TestModule-${{ env.RUNNER_OS_LOWER }}
- name: Publish to Packages (Dependencies)
uses: ./
with:
token: ${{ secrets.GITHUB_TOKEN }}
target: packages
path: tests/library/TestModule-dependencies-${{ env.RUNNER_OS_LOWER }}
- name: Publish to NuGet
uses: ./
with:
token: ${{ secrets.CLOUDSMITH_KEY }}
target: nuget
path: tests/library/TestModule-${{ env.RUNNER_OS_LOWER }}
nugetUrl: https://nuget.cloudsmith.io/natescherer/publish-powershell-action/v3/index.json
- name: Publish to NuGet (Dependencies)
uses: ./
with:
token: ${{ secrets.CLOUDSMITH_KEY }}
target: nuget
path: tests/library/TestModule-dependencies-${{ env.RUNNER_OS_LOWER }}
nugetUrl: https://nuget.cloudsmith.io/natescherer/publish-powershell-action/v3/index.json
- name: Run Pester Tests
id: pester
uses: zyborg/pester-tests-report@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
report_name: TestResults_${{ runner.os }}
tests_fail_step: true
gist_name: ${{ env.BARE_REPOSITORY }}_TestResults_${{ runner.os }}.md
gist_badge_label: ${{ runner.os }}
gist_token: ${{ secrets.PESTER_GIST_TOKEN }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BUILD_NUMBER: ${{ env.BUILD_NUMBER }}