Skip to content

Commit 0498102

Browse files
authored
Merge pull request #1 from DecimalTurn/dev
2 parents 8f503b1 + b2933cb commit 0498102

File tree

90 files changed

+6907
-270
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+6907
-270
lines changed

.devcontainer/devcontainer.json

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,21 @@
55
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
66
"image": "mcr.microsoft.com/devcontainers/base:alpine-3.20",
77
"features": {
8-
"ghcr.io/cirolosapio/devcontainers-features/alpine-node:0": {}
8+
"ghcr.io/cirolosapio/devcontainers-features/alpine-node:0": {
9+
"corepack": true,
10+
"pnpmVersion": "latest"
11+
},
12+
"ghcr.io/devcontainers/features/powershell:1": {
13+
"version": "7.4"
14+
}
15+
},
16+
"customizations": {
17+
"vscode": {
18+
"extensions": [
19+
"ms-vscode.powershell",
20+
"github.vscode-github-actions"
21+
]
22+
}
923
}
1024

1125
// Features to add to the dev container. More info: https://containers.dev/features.

.github/workflows/screenshot_demo.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,12 @@ jobs:
1010
uses: actions/checkout@v4
1111
- name: "Take Screenshot"
1212
run: |
13+
# Minimize the CMD window
14+
. "./scripts/utils/Minimize.ps1"
15+
Minimize-Window "Administrator: C:\actions"
1316
# Take a screenshot of the Office application
1417
. "./scripts/utils/Screenshot.ps1"
15-
Take-Screenshot -OutputPath $outputDir + "Screenshot_${fileNameNoExt}.png"
18+
Take-Screenshot -OutputPath "Screenshot.png"
1619
- name: "Upload Screenshot"
1720
uses: actions/upload-artifact@v4
1821
with:

.github/workflows/tests.yml

Lines changed: 55 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,69 @@
11
name: Test Build VBA
22
on:
3-
- workflow_dispatch
3+
workflow_dispatch:
4+
push:
5+
branches:
6+
- main
7+
- dev*
8+
9+
permissions:
10+
id-token: write
11+
attestations: write
412

513
jobs:
614
build:
715
runs-on: windows-latest
816
steps:
917
- name: "Checkout"
1018
uses: actions/checkout@v4
11-
- name: "Build VBA-Enabled Workbook (using own action)"
19+
- name: "Build VBA-Enabled Documents (using own action)"
20+
id: build_vba
1221
uses: ./
1322
with:
1423
sourceDir: "./tests"
15-
- name: "Upload Artifact"
24+
timeout-minutes: 10
25+
- name: "Display Chocolatey logs in case of Office install failure"
26+
if: failure() && steps.build_vba.outcome == 'failure'
27+
run: |
28+
if (Test-Path -Path "C:\ProgramData\chocolatey\logs\chocolatey.log") {
29+
Write-Host "============ Chocolatey Log Contents ============"
30+
Get-Content -Path "C:\ProgramData\chocolatey\logs\chocolatey.log"
31+
Write-Host "================================================="
32+
} else {
33+
Write-Host "Chocolatey log file not found at C:\ProgramData\chocolatey\logs\chocolatey.log"
34+
}
35+
shell: pwsh
36+
- name: "Upload Build Artifact"
37+
uses: actions/upload-artifact@v4
38+
id: "upload"
39+
with:
40+
name: "VBA-Enabled-Documents"
41+
path: "./tests/out/*"
42+
if-no-files-found: warn
43+
- name: "Take exiting screenshot"
44+
if: always()
45+
run: |
46+
. "./scripts/utils/Screenshot.ps1"
47+
# Create the directory if it does not exist
48+
if (!(Test-Path -Path ${{ github.workspace }}/tests/screenshots)) {
49+
New-Item -ItemType Directory -Path ${{ github.workspace }}/tests/screenshots
50+
}
51+
# Minimize PowerShell window
52+
. "./scripts/utils/Minimize.ps1"
53+
Minimize-Window "Administrator: C:\Program Files\PowerShell\7\pwsh.EXE"
54+
Take-Screenshot -OutputPath ${{ github.workspace }}/tests/screenshots/ExitScreenshot.png
55+
shell: pwsh
56+
# TODO: Check if better method to visualize the screenshots: https://github.com/actions/upload-artifact/issues/14
57+
- name: "Upload Screenshots"
58+
# Run this step even if the build failed
59+
if: always()
1660
uses: actions/upload-artifact@v4
1761
with:
18-
name: "VBA-Enabled Workbook"
19-
path: "./*.xl*"
20-
if-no-files-found: warn
62+
name: "Screenshots"
63+
path: "./tests/screenshots/*"
64+
if-no-files-found: warn
65+
- name: "Attestation"
66+
uses: actions/attest-build-provenance@v2
67+
with:
68+
subject-name: "VBA-Enabled-Documents"
69+
subject-digest: sha256:${{ steps.upload.outputs.artifact-digest }}

Build-VBA.ps1

Lines changed: 0 additions & 118 deletions
This file was deleted.

Enable-VBOM.ps1

Lines changed: 0 additions & 94 deletions
This file was deleted.

0 commit comments

Comments
 (0)