|
| 1 | +# Licensed to the Apache Software Foundation (ASF) under one |
| 2 | +# or more contributor license agreements. See the NOTICE file |
| 3 | +# distributed with this work for additional information |
| 4 | +# regarding copyright ownership. The ASF licenses this file |
| 5 | +# to you under the Apache License, Version 2.0 (the |
| 6 | +# "License"); you may not use this file except in compliance |
| 7 | +# with the License. You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, |
| 12 | +# software distributed under the License is distributed on an |
| 13 | +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 14 | +# KIND, either express or implied. See the License for the |
| 15 | +# specific language governing permissions and limitations |
| 16 | +# under the License. |
| 17 | + |
| 18 | +name: 'Setup CloudStack Environment' |
| 19 | +description: 'Sets up JDK (with Maven cache), optionally Python, and optionally APT build dependencies for CloudStack.' |
| 20 | + |
| 21 | +inputs: |
| 22 | + java-version: |
| 23 | + description: 'The JDK version to use' |
| 24 | + required: false |
| 25 | + default: '17' |
| 26 | + install-python: |
| 27 | + description: 'Whether to install Python 3.10' |
| 28 | + required: false |
| 29 | + default: 'false' |
| 30 | + install-apt-deps: |
| 31 | + description: 'Whether to install CloudStack APT build dependencies' |
| 32 | + required: false |
| 33 | + default: 'false' |
| 34 | + |
| 35 | +runs: |
| 36 | + using: "composite" |
| 37 | + steps: |
| 38 | + - name: Set up JDK ${{ inputs.java-version }} |
| 39 | + uses: actions/setup-java@v4 |
| 40 | + with: |
| 41 | + java-version: ${{ inputs.java-version }} |
| 42 | + distribution: 'temurin' |
| 43 | + architecture: x64 |
| 44 | + cache: 'maven' |
| 45 | + |
| 46 | + - name: Set up Python |
| 47 | + if: ${{ inputs.install-python == 'true' }} |
| 48 | + uses: actions/setup-python@v5 |
| 49 | + with: |
| 50 | + python-version: '3.10' |
| 51 | + architecture: x64 |
| 52 | + |
| 53 | + - name: Install Build Dependencies |
| 54 | + if: ${{ inputs.install-apt-deps == 'true' }} |
| 55 | + shell: bash |
| 56 | + run: | |
| 57 | + sudo apt-get update |
| 58 | + sudo apt-get install -y git uuid-runtime genisoimage netcat-openbsd ipmitool build-essential libgcrypt20 libgpg-error-dev libgpg-error0 libopenipmi0 libpython3-dev libssl-dev libffi-dev python3-openssl python3-dev python3-setuptools |
0 commit comments