-
Notifications
You must be signed in to change notification settings - Fork 7
94 lines (86 loc) · 2.81 KB
/
test-bootstrap.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Test bootstrap
on:
push:
pull_request:
release:
types: [published]
env:
GITHUB_TOKEN: ${{ github.token }}
jobs:
test-bootstrap:
name: |
${{ matrix.platform.os_name }} - ${{ matrix.platform.script }} - ${{ ( matrix.tag == '' && 'no tag' ) || matrix.tag }}
runs-on: ${{ matrix.platform.os }}
container: ${{ matrix.platform.container }}
strategy:
fail-fast: false
matrix:
platform:
- os_name: Linux
os: ubuntu-latest
script: bootstrap-ubi.sh
- os_name: Alpine Linux (ash)
os: ubuntu-latest
container:
image: alpine:latest
env:
GITHUB_TOKEN: ${{ github.token }}
volumes:
- "${{ github.workspace }}:/workspace"
options: "--workdir /workspace"
script: bootstrap-ubi.sh
- os_name: macOS
os: macOS-latest
script: bootstrap-ubi.sh
- os_name: Windows
os: windows-latest
script: bootstrap-ubi.ps1
# Curl seems to be broken in this environment for some reason. See here for an example -
# https://github.com/houseabsolute/ubi/actions/runs/10022996389/job/27703398529
#
# - os_name: Windows
# os: windows-latest
# script: bootstrap-ubi.sh
tag:
- ""
- v0.1.1
exclude:
- platform:
os: windows-latest
tag: v0.1.1
steps:
- uses: actions/checkout@v4
- name: Install curl and sudo on Alpine
shell: sh
run: |
apk update
apk add curl sudo
if: matrix.platform.container != null
- name: Run bootstrap script
shell: sh
run: |
set -e
set -x
if [ $( id -u ) -eq 0 ]; then
adduser -D github
sudo -u github ./bootstrap/test/test-bootstrap.sh "${{ matrix.platform.script }}" "${{ matrix.tag }}"
else
./bootstrap/test/test-bootstrap.sh "${{ matrix.platform.script }}" "${{ matrix.tag }}"
fi
exit 0
if: ${{ matrix.platform.script == 'bootstrap-ubi.sh' }}
- name: Run bootstrap script
shell: powershell
run: |
powershell -exec bypass ./bootstrap/bootstrap-ubi.ps1
if ( -not( Test-Path -Path "ubi.exe" ) ) {
Write-Host "Running ./bootstrap/${{ matrix.platform.script }} did not install ubi!"
exit 1
}
./ubi.exe --project houseabsolute/precious --in "."
if ( -not( Test-Path -Path "precious.exe" ) ) {
Write-Host "Running ubi did not install precious!"
exit 2
}
exit 0
if: ${{ matrix.platform.script == 'bootstrap-ubi.ps1' }}