Repository navigation
52 lines (52 loc) · 1.61 KB
/
Copy pathvalidate-module-source.yml
File metadata and controls
52 lines (52 loc) · 1.61 KB
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
name: Read-only module source validation
on:
workflow_call:
inputs:
module:
required: true
type: string
source_sha:
required: true
type: string
automation_sha:
required: true
type: string
permissions:
contents: read
jobs:
test:
runs-on: ${{ matrix.os }}
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
os: ${{ fromJSON(inputs.module == '7zip-Archive' && '["windows-latest"]' || '["windows-latest","ubuntu-latest","macos-latest"]') }}
steps:
- uses: actions/checkout@v7.0.1
with:
ref: ${{ inputs.automation_sha }}
path: automation
persist-credentials: false
- name: Require exact commits
shell: pwsh
env:
SOURCE_SHA: ${{ inputs.source_sha }}
AUTOMATION_SHA: ${{ inputs.automation_sha }}
run: |
if ($env:SOURCE_SHA -cnotmatch '^[0-9a-f]{40}$' -or $env:AUTOMATION_SHA -cnotmatch '^[0-9a-f]{40}$') { throw 'Full commit SHAs required' }
- uses: actions/checkout@v7.0.1
with:
ref: ${{ inputs.source_sha }}
path: source
persist-credentials: false
- name: Test the actual module source snapshot
shell: pwsh
env:
MODULE: ${{ inputs.module }}
run: ./automation/scripts/ci/Invoke-ModuleTests.ps1 -Module $env:MODULE -SourceRoot ./source
- uses: actions/upload-artifact@v7.0.2
if: always()
with:
name: source-${{ inputs.module }}-${{ matrix.os }}
path: source/TestResults/*.xml
if-no-files-found: ignore