-
Notifications
You must be signed in to change notification settings - Fork 0
118 lines (105 loc) · 4.49 KB
/
Copy pathci.yml
File metadata and controls
118 lines (105 loc) · 4.49 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
name: CI
on:
push:
pull_request:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
ci:
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, macos-latest, windows-2025]
runs-on: ${{ matrix.os }}
timeout-minutes: 25
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
# Install before setup-node so its pnpm cache can locate the store.
- name: Install pnpm
run: |
npm install --prefix "$RUNNER_TEMP/scriptfs-pnpm" --no-audit --no-fund pnpm@12.4.0
# pnpm's installer changes Windows bin targets to .exe; refresh npm's launchers.
if [ "$RUNNER_OS" = "Windows" ]; then
npm rebuild --prefix "$RUNNER_TEMP/scriptfs-pnpm" --ignore-scripts --no-audit --no-fund pnpm
fi
echo "$RUNNER_TEMP/scriptfs-pnpm/node_modules/.bin" >> "$GITHUB_PATH"
- uses: actions/setup-node@v7
with:
node-version: 22
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Portable checks
run: pnpm check
- name: Install Linux integration prerequisites
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y podman cifs-utils
sudo modprobe fuse
sudo modprobe cifs
test -c /dev/fuse
sudo podman info
- name: Build fresh Linux runtime
if: runner.os == 'Linux'
run: |
sudo podman build \
--build-arg "NPM_REGISTRY=$(npm config get registry)" \
--tag localhost/scriptfs-runtime:0.0.2 \
--file container/Containerfile .
- name: Linux FUSE and SMB integration
if: runner.os == 'Linux'
run: |
sudo env "PATH=$PATH" "CI=true" \
"NPM_CONFIG_USERCONFIG=$(npm config get userconfig)" \
pnpm test:e2e
- name: Install Windows integration prerequisites
if: runner.os == 'Windows'
shell: pwsh
run: |
$installer = Join-Path $env:RUNNER_TEMP 'podman.msi'
Invoke-WebRequest -Uri 'https://github.com/podman-container-tools/podman/releases/download/v5.8.3/podman-installer-windows-amd64.msi' -OutFile $installer
if ((Get-FileHash $installer -Algorithm SHA256).Hash -ne '2c5cffb2f023ae122d52d7f4b30bb677adb933fb7aa7ad708d3d544f8d6fe13a') {
throw 'Podman installer checksum did not match.'
}
$installation = Start-Process msiexec.exe -Wait -PassThru -ArgumentList "/i `"$installer`" /qn /norestart"
if ($installation.ExitCode -ne 0) { throw "Podman installation failed: $($installation.ExitCode)" }
$env:PATH = $env:PATH + ';' + [Environment]::GetEnvironmentVariable('Path', 'Machine') + ';' + [Environment]::GetEnvironmentVariable('Path', 'User')
$podmanDirectory = Split-Path (Get-Command podman -ErrorAction Stop).Source
Add-Content -Path $env:GITHUB_PATH -Value $podmanDirectory
podman machine init
if ($LASTEXITCODE -ne 0) { throw 'Podman machine initialization failed.' }
podman machine start
if ($LASTEXITCODE -ne 0) { throw 'Podman machine startup failed.' }
podman machine ssh 'test -c /dev/fuse'
if ($LASTEXITCODE -ne 0) { throw 'The Podman machine has no /dev/fuse device.' }
node .\dist\cli.js --check
if ($LASTEXITCODE -ne 0) { throw 'ScriptFS Podman preflight failed.' }
- name: Build fresh Windows runtime
if: runner.os == 'Windows'
shell: pwsh
run: |
$registry = npm config get registry
if ($LASTEXITCODE -ne 0) { throw 'Could not determine the npm registry.' }
podman build --build-arg "NPM_REGISTRY=$registry" --build-arg RUN_NATIVE_SANITIZERS=false --tag localhost/scriptfs-runtime:0.0.2 --file .\container\Containerfile .
if ($LASTEXITCODE -ne 0) { throw 'Windows runtime image build failed.' }
- name: Windows FUSE and SMB integration
if: runner.os == 'Windows'
run: pnpm test:e2e
- name: Stop Windows Podman machine
if: always() && runner.os == 'Windows'
shell: pwsh
run: |
if (Get-Command podman -ErrorAction SilentlyContinue) {
podman machine stop
if ($LASTEXITCODE -ne 0) { throw 'Podman machine cleanup failed.' }
}