-
Notifications
You must be signed in to change notification settings - Fork 14
78 lines (70 loc) · 2.84 KB
/
release-test-installer.yaml
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
name: release-test-installer
on:
# Manual trigger
workflow_dispatch: {}
# Automatic trigger after each release
# Note: Triggers on both successes and failures (see conditional below)
workflow_run:
workflows:
- release
types:
- completed
jobs:
install_script:
strategy:
fail-fast: false
matrix:
include:
# Keep in sync with artifact upload matrix below
#
# TODO: Add minimal targets that are stripped and do not embed WebUI
- name: Linux / amd64 / glibc
runs-on: ubuntu-latest
expected-target: x86_64-unknown-linux-gnu
expected-install-path: /home/runner/.local/bin/kamu
- name: Linux / amd64 / musl
runs-on: ubuntu-latest
installer-vars: KAMU_LIBC=musl
expected-target: x86_64-unknown-linux-musl
expected-install-path: /home/runner/.local/bin/kamu
- name: MacOS / amd64
runs-on: macos-13
expected-target: x86_64-apple-darwin
expected-install-path: /Users/runner/.local/bin/kamu
- name: MacOS / arm64
runs-on: macos-14
expected-target: aarch64-apple-darwin
expected-install-path: /Users/runner/.local/bin/kamu
name: Install via script (${{ matrix.name }})
runs-on: ${{ matrix.runs-on }}
if: |
github.event.workflow_run.conclusion == 'success' ||
github.event.workflow_run.conclusion == null
steps:
- uses: actions/checkout@v4
- name: Read latest version
uses: SebRollen/[email protected]
id: read_version
with:
file: Cargo.toml
field: workspace.package.version
- name: Install release
shell: bash
run: |
curl -s "https://get.kamu.dev" | \
KAMU_VERSION=${{ steps.read_version.outputs.value }} \
${{ matrix.installer-vars }} \
sh -s
echo $(dirname ${{ matrix.expected-install-path }}) >> $GITHUB_PATH
- name: Test release
shell: bash
run: |
echo "Installed version info:"
kamu version
assert_eq() { if [[ "$1" == "$2" ]]; then true; else echo "$3, expected $2 but got $1"; false; fi }
assert_eq "$(kamu version --output-format json | jq -r .appVersion)" "${{ steps.read_version.outputs.value }}" "Invalid version"
assert_eq "$(kamu version --output-format json | jq -r .cargoOptLevel)" "3" "Invalid optimization level"
assert_eq "$(kamu version --output-format json | jq -r .cargoTargetTriple)" "${{ matrix.expected-target }}" "Invalid target"
assert_eq "$(which kamu)" "${{ matrix.expected-install-path }}" "Invalid install path"
kamu init
assert_eq "$(kamu list --output-format csv)" "Name,Kind,Pulled,Records,Size" "Unexpected list output"