forked from 2i2c-org/infrastructure
-
Notifications
You must be signed in to change notification settings - Fork 0
96 lines (87 loc) · 2.97 KB
/
validate-clusters.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# This is a GitHub workflow defining a set of jobs with a set of steps. ref:
# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions
#
# Runs the deployer script to validate clusters. This will both validate
# cluster.yaml files as well as each hubs passed non-encrypted values files
# against the Helm charts' values schema.
#
name: Validate clusters
on:
pull_request:
paths:
- config/clusters/**
- deployer/**
- helm-charts/basehub/**
- helm-charts/daskhub/**
- requirements.txt
- .github/workflows/validate-hubs.yaml
push:
paths:
- config/clusters/**
- deployer/**
- helm-charts/basehub/**
- helm-charts/daskhub/**
- requirements.txt
- .github/workflows/validate-hubs.yaml
branches-ignore:
- "dependabot/**"
- "pre-commit-ci-update-config"
tags:
- "**"
workflow_dispatch:
jobs:
validate-hubs-values-files:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- cluster_name: 2i2c
- cluster_name: azure.carbonplan
- cluster_name: carbonplan
- cluster_name: cloudbank
- cluster_name: farallon
- cluster_name: meom-ige
- cluster_name: openscapes
- cluster_name: pangeo-hubs
- cluster_name: utoronto
- cluster_name: uwhackweeks
steps:
- uses: actions/checkout@v2
- name: Check if any cluster common files has changed
uses: dorny/paths-filter@v2
id: cluster_common_files
with:
filters: |
files:
- deployer/**
- helm-charts/basehub/**
- helm-charts/daskhub/**
- requirements.txt
- .github/workflows/validate-hubs.yaml
- name: Check if cluster specific files has changes
uses: dorny/paths-filter@v2
id: cluster_specific_files
with:
filters: |
changes:
- config/clusters/${{ matrix.cluster_name }}/**
# To continue this cluster specific job we must either have manually
# invoked this workflow to run for all clusters, or there should have been
# changes to the cluster common files or cluster specific files.
- name: Decide if the job should continue
id: decision
run: |
echo ::set-output name=continue-job::${{ github.event_name == 'workflow_dispatch' || (steps.cluster_common_files.outputs.files == 'true' || steps.cluster_specific_files.outputs.changes == 'true') }}
- uses: actions/setup-python@v3
with:
python-version: "3.9"
- name: Install deployer script dependencies
run: |
pip install -r requirements.txt
- name: "Validate cluster: ${{ matrix.cluster_name }}"
if: steps.decision.outputs.continue-job == 'true'
env:
TERM: xterm
run: |
python deployer validate ${{ matrix.cluster_name }}