aboutsummaryrefslogtreecommitdiff
path: root/.github/actions/stasis_install/action.yml
blob: 0fe88f2b710810d62b10725fdb740d3e4d91be56 (plain) (blame)
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
name: Install STASIS

description: |
  Installs STASIS

inputs:
  prefix:
    type: string
    description: STASIS installation prefix
    required: false
    default: "${{ github.workspace }}/.local"

  build_type:
    type: string
    description: |
      Type of build:
        Release, RelWithDebInfo, Debug, or MinSizeRel
    required: false
    default: "${{ github.workspace }}/.local"

outputs:
  installdir:
    description: STASIS installation directory
    value: ${{ steps.install-stasis.outputs.installdir }}

  bindir:
    description: STASIS bin directory
    value: ${{ steps.install-stasis.outputs.bindir }}

  sysconfdir:
    description: STASIS etc directory
    value: ${{ steps.install-stasis.outputs.sysconfdir }}

runs:
  using: "composite"
  steps:
    - uses: actions/checkout@v4
      with:
        repository: 'spacetelescope/stasis'
        path: ${{ github.workspace }}/stasis

    - name: Install STASIS dependencies
      run: |
        sudo apt-get update
        sudo apt-get install -y ca-certificates cmake libcurl4-openssl-dev libxml2-dev rsync
      shell: bash

    - name: Install STASIS
      id: install-stasis
      run: |
        rm -rf ${{ github.workspace }}/stasis/build
        cd ${{ github.workspace }}/stasis
        mkdir -p build
        cd build
        cmake .. \
            -DCMAKE_INSTALL_PREFIX="${{ inputs.prefix }}" \
            -DCMAKE_BUILD_TYPE="${{ inputs.build_type }}"
        make
        make install
        echo "installdir=${{ inputs.prefix }}" >> $GITHUB_OUTPUT
        echo "bindir=${{ inputs.prefix }}/bin" >> $GITHUB_OUTPUT
        echo "sysconfdir=${{ inputs.prefix }}/etc" >> $GITHUB_OUTPUT
      shell: bash

    - name: Remove STASIS source
      run: |
        rm -rf ${{ github.workspace }}/stasis
      shell: bash