-
Notifications
You must be signed in to change notification settings - Fork 3
130 lines (125 loc) · 4.09 KB
/
ci.yml
File metadata and controls
130 lines (125 loc) · 4.09 KB
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: CI
on:
push:
branches:
- main
tags:
- '*'
pull_request:
branches:
- '*'
env:
REGISTRY: ghcr.io
IMAGE_BASE: ${{ github.repository }}
jobs:
build:
name: Build all SciServer components
runs-on: ubuntu-latest
outputs:
VTAG: ${{ steps.vtag_output.outputs.VTAG }}
steps:
- uses: actions/checkout@v4
- name: get tags
run: git fetch --tags origin
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
cache: 'gradle'
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: install python dependencies
run: |
python3 -m pip install --upgrade pip
pip3 install tox build
- run: make
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/metadata-action@v5
id: dockermeta
- name: Store version tag
id: vtag_output
run:
echo VTAG=${{ fromJSON(steps.dockermeta.outputs.json).labels['org.opencontainers.image.version'] }} >> $GITHUB_OUTPUT
- name: Build and push docker images
run: make publish-images REPO=${{ env.REGISTRY }}/${{ env.IMAGE_BASE }} VTAG=${{ steps.vtag_output.outputs.VTAG }}
- uses: actions/upload-artifact@v4
if: always()
with:
name: test-reports
path: components/java/**/build/reports/tests/test/
- uses: actions/upload-artifact@v4
if: always()
with:
name: checkstyle-reports
path: components/java/**/build/reports/checkstyle/
helm:
needs: build
name: publish helm charts
concurrency:
group: helm-charts-publication
cancel-in-progress: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: get tags
run: git fetch --tags origin
- name: Generate hash-version helm tarball (non-release builds only)
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
run: |
short_hash=$(git rev-parse --short=7 HEAD)
make helm REPO=${{ env.REGISTRY }}/${{ env.IMAGE_BASE }} VTAG=g${short_hash}
- name: Generate tagged-version helm tarball
run: make helm REPO=${{ env.REGISTRY }}/${{ env.IMAGE_BASE }} VTAG=${{ needs.build.outputs.VTAG }}
- name: configure git for helm release
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: upload chart to pages for development builds
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
run: |
git checkout gh-pages
mv helm/build/sciserver-*.tgz .
git add sciserver-*.tgz
git commit -m "upload development helm charts for ${{ github.ref }}"
git push
- name: swap built helm charts for release builds
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
run: |
rm -rf helm/sciserver
mv helm/build/sciserver helm/sciserver
- name: helm chart release
uses: helm/chart-releaser-action@v1.7.0
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
with:
charts_dir: helm/
mark_as_latest: true
packages_with_index: true
env:
CR_TOKEN: ${{ secrets.GITHUB_TOKEN }}
docs:
name: Build docs with Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ 3.11 ]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
pip3 install -r docs/requirements.txt
shell: bash
- name: Build sphinx docs.
shell: bash
working-directory: docs
run: make html