Skip to content

Commit d8d7edc

Browse files
committed
Refactor github actions
1 parent 7ad68aa commit d8d7edc

File tree

8 files changed

+343
-559
lines changed

8 files changed

+343
-559
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: 'Install CloudStack Non-OSS'
2+
description: 'Clones and installs the shapeblue/cloudstack-nonoss repository.'
3+
4+
runs:
5+
using: "composite"
6+
steps:
7+
- name: Install cloudstack-nonoss
8+
shell: bash
9+
run: |
10+
git clone https://github.com/shapeblue/cloudstack-nonoss.git nonoss
11+
cd nonoss
12+
bash -x install-non-oss.sh
13+
cd ..
14+
rm -fr nonoss
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: 'Setup CloudStack Environment'
2+
description: 'Sets up JDK (with Maven cache), optionally Python, and optionally APT build dependencies for CloudStack.'
3+
4+
inputs:
5+
java-version:
6+
description: 'The JDK version to use'
7+
required: false
8+
default: '17'
9+
install-python:
10+
description: 'Whether to install Python 3.10'
11+
required: false
12+
default: 'false'
13+
install-apt-deps:
14+
description: 'Whether to install CloudStack APT build dependencies'
15+
required: false
16+
default: 'false'
17+
18+
runs:
19+
using: "composite"
20+
steps:
21+
- name: Set up JDK ${{ inputs.java-version }}
22+
uses: actions/setup-java@v4
23+
with:
24+
java-version: ${{ inputs.java-version }}
25+
distribution: 'temurin'
26+
architecture: x64
27+
cache: 'maven'
28+
29+
- name: Set up Python
30+
if: ${{ inputs.install-python == 'true' }}
31+
uses: actions/setup-python@v5
32+
with:
33+
python-version: '3.10'
34+
architecture: x64
35+
36+
- name: Install Build Dependencies
37+
if: ${{ inputs.install-apt-deps == 'true' }}
38+
shell: bash
39+
run: |
40+
sudo apt-get update
41+
sudo apt-get install -y git uuid-runtime genisoimage netcat-openbsd ipmitool build-essential libgcrypt20 libgpg-error-dev libgpg-error0 libopenipmi0 ipmitool libpython3-dev libssl-dev libffi-dev python3-openssl python3-dev python3-setuptools

.github/workflows/build.yml

Lines changed: 25 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -16,53 +16,36 @@
1616
# under the License.
1717

1818
name: Build
19-
20-
on: [push, pull_request]
21-
19+
on:
20+
- push
21+
- pull_request
2222
concurrency:
2323
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
24-
cancel-in-progress: true
25-
24+
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
2625
permissions:
2726
contents: read
28-
2927
jobs:
3028
build:
3129
runs-on: ubuntu-22.04
3230
steps:
33-
- uses: actions/checkout@v5
34-
35-
- name: Set up JDK 17
36-
uses: actions/setup-java@v5
37-
with:
38-
distribution: 'temurin'
39-
java-version: '17'
40-
cache: 'maven'
41-
42-
- name: Set up Python
43-
uses: actions/setup-python@v6
44-
with:
45-
python-version: '3.10'
46-
architecture: 'x64'
47-
48-
- name: Install Build Dependencies
49-
run: |
50-
sudo apt-get update
51-
sudo apt-get install -y git uuid-runtime genisoimage netcat ipmitool build-essential libgcrypt20 libgpg-error-dev libgpg-error0 libopenipmi0 ipmitool libpython3-dev libssl-dev libffi-dev python3-openssl python3-dev python3-setuptools
52-
53-
- name: Env details
54-
run: |
55-
uname -a
56-
whoami
57-
javac -version
58-
mvn -v
59-
python3 --version
60-
free -m
61-
nproc
62-
git status
63-
64-
- name: Noredist Build
65-
run: |
66-
git clone https://github.com/shapeblue/cloudstack-nonoss.git nonoss && cd nonoss && bash -x install-non-oss.sh && cd ..
67-
rm -fr nonoss
68-
mvn -B -P developer,systemvm -Dsimulator -Dnoredist clean install -T$(nproc)
31+
- uses: actions/checkout@v5
32+
- name: Setup Environment
33+
uses: ./.github/actions/setup-env
34+
with:
35+
install-python: 'true'
36+
install-apt-deps: 'true'
37+
- name: Env details
38+
run: |
39+
uname -a
40+
whoami
41+
javac -version
42+
mvn -v
43+
python3 --version
44+
free -m
45+
nproc
46+
git status
47+
- name: Install Non-OSS
48+
uses: ./.github/actions/install-nonoss
49+
- name: Noredist Build
50+
run: |
51+
mvn -B -P developer,systemvm -Dsimulator -Dnoredist clean install -T$(nproc)

0 commit comments

Comments
 (0)