-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaction.yml
98 lines (86 loc) · 3.47 KB
/
action.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
95
96
97
98
name: Install MonetDB
description: Install MonetDB and make it ready for use
inputs:
version:
description: "Version of MonetDB to install"
required: false
default: Latest
outputs:
prefix:
description: directory prefix under which everything has been installed
value: ${{ steps.set_output.outputs.prefix }}
bindir:
description: directory under $prefix where binaries has been installed
value: ${{ steps.set_output.outputs.bindir }}
includedir:
description: directory under $prefix where include files has been installed
value: ${{ steps.set_output.outputs.includedir }}
libdir:
description: directory under $prefix where libraries has been installed
value: ${{ steps.set_output.outputs.libdir }}
dynsuffix:
description: "the extension used for shared libraries on this platform: so, dylib or dll"
value: ${{ steps.set_output.outputs.dynsuffix }}
versionnumber:
description: "installed version of MonetDB, for example 11.51.5"
value: ${{ steps.versionlookup.outputs.numeric }}
# input: version
# output: version_number
runs:
using: "composite"
steps:
# this step has outputs 'numeric'
- id: versionlookup
run: |
python3 "$GITHUB_ACTION_PATH"/lookup-version.py "${{ inputs.version }}" ${{ runner.os == 'Windows' && '--msi' || '' }} >"$GITHUB_OUTPUT"
cat "$GITHUB_OUTPUT"
shell: bash
# This step leaves GITHUB_OUTPUT in the file github.output
- name: Linux Package Install
if: runner.os == 'Linux'
run: |
echo "$GITHUB_ACTION_PATH"
ls "$GITHUB_ACTION_PATH"
"$GITHUB_ACTION_PATH"/install-linux-bin.sh "${{ steps.versionlookup.outputs.numeric }}"
shell: bash
# This step leaves GITHUB_OUTPUT in the file github.output
- name: MacOS Homebrew Install
if: runner.os == 'macOS'
run: |
"$GITHUB_ACTION_PATH"/install-macos-bin.sh "${{ steps.versionlookup.outputs.numeric }}"
shell: bash
# This step leaves GITHUB_OUTPUT in the file github.output.
# It also updates $GITHUP_PATH.
- name: Windows MSI Install
if: runner.os == 'Windows'
run: ${{ github.action_path}}\install-windows-bin.ps1 "${{ steps.versionlookup.outputs.main_msi }}" "${{ steps.versionlookup.outputs.odbc_msi }}"
shell: pwsh
- name: Check whether the server is really running
run: python3 "$GITHUB_ACTION_PATH"/connect-to-socket.py
shell: bash
- name: Create .monetdb
run: |
echo user=monetdb >> $HOME/.monetdb
echo password=monetdb >> $HOME/.monetdb
shell: bash
- name: Create a scratch venv
id: venv
# The python / python3 conditional is needed on windows-2019 runners
run: |
${{ runner.os == 'Windows' && 'python' || 'python3' }} -m venv "$RUNNER_TEMP"/install-monetdb-venv
echo "activate=$RUNNER_TEMP/install-monetdb-venv/${{ runner.os == 'Windows' && 'Scripts' || 'bin' }}/activate" >>"$GITHUB_OUTPUT"
shell: bash
- name: Verify that the correct version has been installed
run: |
. '${{ steps.venv.outputs.activate }}'
python -m pip install pymonetdb
python "$GITHUB_ACTION_PATH"/verify-with-pymonetdb.py monetdb:///demo --expect-version="${{ steps.versionlookup.outputs.numeric }}"
shell: bash
# This step picks up the github.output file generated
# by the earlier install step
- name: Communicate prefix, bindir, libdir, includedir and dynsuffix
id: set_output
run: |
cat github.output # should have been generated by install-*-bin.sh
cat github.output >>$GITHUB_OUTPUT
shell: bash