-
Notifications
You must be signed in to change notification settings - Fork 8
78 lines (65 loc) · 2.39 KB
/
build.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
name: Build ROCK
on:
workflow_call:
inputs:
branch:
type: string
default: ''
jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install yamllint
run: python3 -m pip install yamllint
- name: YAML Lint
run: |
yamllint -d "{extends: relaxed, rules: {line-length: {max: 250}}}" \
--no-warnings images/charmed-spark/rockcraft.yaml
yamllint -d "{extends: relaxed, rules: {line-length: {max: 250}}}" \
--no-warnings images/charmed-spark-gpu/rockcraft.yaml
build:
runs-on: ubuntu-latest
timeout-minutes: 30
needs:
- lint
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
- name: Setup LXD
uses: canonical/setup-lxd@main
with:
channel: 5.21/stable
- name: Install dependencies
run: |
sudo snap install yq
sudo snap install rockcraft --classic --edge
- name: Build image
run: sudo make build
- name: Build image (Jupyter)
run: sudo make build FLAVOUR=jupyter
- name: Build image (Kyuubi)
run: sudo make build FLAVOUR=kyuubi
- name: Get Artifact Name
id: artifact
run: |
BASE_ARTIFACT=$(make help | grep 'Artifact: ')
echo "base_artifact_name=${BASE_ARTIFACT#'Artifact: '}" >> $GITHUB_OUTPUT
JUPYTER_ARTIFACT=$(make help FLAVOUR=jupyter | grep 'Artifact: ')
echo "jupyter_artifact_name=${JUPYTER_ARTIFACT#'Artifact: '}" >> $GITHUB_OUTPUT
KYUUBI_ARTIFACT=$(make help FLAVOUR=kyuubi | grep 'Artifact: ')
echo "kyuubi_artifact_name=${KYUUBI_ARTIFACT#'Artifact: '}" >> $GITHUB_OUTPUT
- name: Change artifact permissions
run: sudo chmod a+r ${{ steps.artifact.outputs.base_artifact_name }} ${{ steps.artifact.outputs.jupyter_artifact_name }} ${{ steps.artifact.outputs.kyuubi_artifact_name }}
- name: Upload locally built artifact
uses: actions/upload-artifact@v4
with:
name: charmed-spark
path: |
${{ steps.artifact.outputs.base_artifact_name }}
${{ steps.artifact.outputs.jupyter_artifact_name }}
${{ steps.artifact.outputs.kyuubi_artifact_name }}