-
Notifications
You must be signed in to change notification settings - Fork 5
126 lines (120 loc) · 4.54 KB
/
CI.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
119
120
121
122
123
124
125
126
name: CI
on:
pull_request:
push:
branches: main
tags: "*"
jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
version:
- "1.6" # Earliest supported version of Julia
- "1" # Latest Julia release
os:
- ubuntu-latest
arch:
- x64
env:
K8S_CLUSTER_TESTS: "false"
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: julia-actions/cache@v1
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v3
docs:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: julia-actions/setup-julia@v1
with:
version: "1"
- uses: julia-actions/cache@v1
- run: |
julia --project=docs -e '
using Pkg
Pkg.develop(PackageSpec(path=pwd()))
Pkg.instantiate()'
- run: julia --project=docs docs/make.jl
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
cluster-test:
name: Cluster Test - Julia ${{matrix.julia-version }} - K8s ${{ matrix.k8s-version }} - minikube ${{ matrix.minikube-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
julia-version:
- "1"
# Support the latest versions of the supported releases: https://kubernetes.io/releases/.
# These must be full version numbers including the patch.
k8s-version:
- "1.24.12"
- "1.25.8"
- "1.26.3"
minikube-version:
- "1.29.0"
env:
K8S_CLUSTER_TESTS: "true"
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.julia-version }}
- uses: julia-actions/cache@v1
- uses: julia-actions/julia-buildpkg@v1
# https://github.com/marketplace/actions/docker-setup-buildx
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build Docker image
run: |
GIT_REV=$(git rev-parse --short HEAD)
IMAGE=k8s-cluster-managers:$GIT_REV
echo "K8S_CLUSTER_MANAGERS_TEST_IMAGE=$IMAGE" >> $GITHUB_ENV
docker build -t $IMAGE .
# Factors influencing the setup of the "local" Kubernetes cluster:
# - Limited resources on GitHub runners only allow running a 1 pod at a time with
# the default minikube install (additional jobs would be stuck as "Pending")
# - minikube restricts max CPUs per node to the number of CPUs on the host
# - minikube "none" driver only supports a single node (due to port conflicts)
# - minikube "docker" driver requires local-only images to present on the node where
# it is used (all nodes in practice)
- name: Set up minikube
uses: manusa/[email protected]
with:
# https://github.com/kubernetes/minikube/releases
minikube version: v${{ matrix.minikube-version }}
# Needs to match the tags format: https://github.com/kubernetes/kubernetes/tags
kubernetes version: v${{ matrix.k8s-version }}
driver: docker
start args: --nodes=2 --cni=kindnet
# To use a Docker image in the cluster it must first be made available to the cluster
# nodes. In single node clusters the easy way to do this with the Docker driver would
# be to use `minikube docker-env` but since we're using multi-node cluster we have to
# take an alternate approach. The recommended way is to use the registry addon but
# requires more setup than the current approach of directly transferring the image to
# each of the nodes.
- name: Push image to node(s)
run: |
for node in $(minikube node list | cut -f1); do
echo "Transfering image to node $node..."
docker save $K8S_CLUSTER_MANAGERS_TEST_IMAGE | minikube ssh --node $node --native-ssh=false -- docker load
done
- uses: julia-actions/julia-runtest@v1
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v3