-
Notifications
You must be signed in to change notification settings - Fork 11
118 lines (103 loc) · 3.08 KB
/
test_and_publish.yml
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
---
name: Test and Publish
on:
pull_request:
push:
jobs:
precommit:
runs-on: ubuntu-22.04
timeout-minutes: 2
name: Run pre-commit
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: pre-commit/[email protected]
test_omero:
runs-on: ubuntu-22.04
timeout-minutes: 20
name: Test OMERO Helm charts
strategy:
fail-fast: false
matrix:
include:
- k3s-version: v1.21.0+k3s1
helm-version: v3.5.4
# v4 supports k3s 1.24+
k3s-helm-version: v3
- k3s-version: v1.31.1+k3s1
helm-version: v3.16.2
steps:
- uses: actions/checkout@v4
with:
# chartpress requires the full history
fetch-depth: 0
- uses: jupyterhub/action-k3s-helm@v3
if: matrix.k3s-helm-version == 'v3'
with:
k3s-version: ${{ matrix.k3s-version }}
helm-version: ${{ matrix.helm-version }}
# This action should export KUBECONFIG
- uses: jupyterhub/action-k3s-helm@v4
if: matrix.k3s-helm-version != 'v3'
with:
k3s-version: ${{ matrix.k3s-version }}
helm-version: ${{ matrix.helm-version }}
# This action should export KUBECONFIG
- name: Install dependencies
run: |
conda install -y -q -c conda-forge python=3.10 omero-py pytest requests ruamel.yaml docker-py
# $CONDA/bin/pip install -r dev-requirements.txt
echo "$CONDA/bin" >> $GITHUB_PATH
- name: Build
run: ./ci/build.sh
- name: Test
run: ./ci/test.sh
# This job can be used as a required status for Pull Requests
status:
runs-on: ubuntu-22.04
timeout-minutes: 2
name: Status
needs:
- precommit
- test_omero
steps:
- name: Status
run: |
echo "precommit: ${{ needs.precommit.result }}"
echo "test_omero: ${{ needs.test_omero.result }}"
publish:
runs-on: ubuntu-22.04
permissions:
contents: write
name: Publish OMERO Helm charts
if: github.ref == 'refs/heads/main'
needs:
- precommit
- test_omero
steps:
- uses: actions/checkout@v4
with:
# chartpress requires the full history
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: pip
cache-dependency-path: dev-requirements.txt
- uses: azure/setup-helm@v4
with:
version: v3.16.2
- name: Install dependencies
run: pip install -r dev-requirements.txt
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Publish
run: ./ci/chartpress.py --git-release --tag-latest --push --publish-chart --git-push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Required for git commit:
EMAIL: [email protected]
GIT_AUTHOR_NAME: chartpress-bot
GIT_COMMITTER_NAME: chartpress-bot