-
Notifications
You must be signed in to change notification settings - Fork 44
47 lines (42 loc) · 1.43 KB
/
test-install.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
name: Installation Test
on:
release:
types: [published]
workflow_dispatch: {}
jobs:
test-installation:
name: Test Installation
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
shell: bash
script_section: UNIX_INSTALLATION
- os: macos-latest
target: x86_64-apple-darwin
shell: bash
script_section: UNIX_INSTALLATION
- os: windows-latest
target: x86_64-pc-windows-msvc
shell: powershell
script_section: WINDOWS_INSTALLATION
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Get installation script
id: get_install_script
shell: bash
run: |
script=$(awk '/<!-- ${{ matrix.script_section }}_BEGIN -->/{p=1;next}/<!-- ${{ matrix.script_section }}_END -->/{p=0}p' README.md | grep -v '^```')
[ -n "$script" ] || { echo "Could not extract installation script"; exit 1; }
script="${script//'%'/'%25'}"
script="${script//$'\n'/'%0A'}"
script="${script//$'\r'/'%0D'}"
echo "script=$script" >> $GITHUB_OUTPUT
- name: Test installation script
shell: bash
run: ${{ steps.get_install_script.outputs.script }}
- name: Verify final installation
run: yek --help