-
Notifications
You must be signed in to change notification settings - Fork 15
82 lines (69 loc) · 2.62 KB
/
version-test.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
name: "PR Update : Test matching versions"
on:
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
env:
ALL_VERSIONS_MATCH: false
steps:
- uses: actions/checkout@v2
- name: Install Hatch
run: |
python -m pip install --upgrade pip
pip install hatch
#
# Collect from Python / hatch
#
- name: Find the version of DJ Server
working-directory: ./datajunction-server
run:
echo "DJ_SERVER_VERSION=`hatch version`" >> $GITHUB_ENV
- name: Find the version of DJ Query service
working-directory: ./datajunction-query
run:
echo "DJ_QUERY_VERSION=`hatch version`" >> $GITHUB_ENV
- name: Find the version of DJ Reflection service
working-directory: ./datajunction-reflection
run:
echo "DJ_REFLECTION_VERSION=`hatch version`" >> $GITHUB_ENV
- name: Find the version of DJ Python client
working-directory: ./datajunction-clients/python
run:
echo "DJ_CLIENT_PY_VERSION=`hatch version`" >> $GITHUB_ENV
#
# Collect from JavaScript / yarn
#
- name: Find the version of DJ UI
working-directory: ./datajunction-ui
run:
echo "DJ_UI_VERSION=`cat package.json | jq -r '.version'`" >> $GITHUB_ENV
- name: Find the version of DJ Javascript client
working-directory: ./datajunction-clients/javascript
run:
echo "DJ_CLIENT_JS_VERSION=`cat package.json | jq -r '.version'`" >> $GITHUB_ENV
#
# Collect from Java / gradle (TODO)
#
#
# Evaluate
#
- name: All versions match!
if: ${{ env.DJ_SERVER_VERSION == env.DJ_QUERY_VERSION && env.DJ_SERVER_VERSION == env.DJ_REFLECTION_VERSION && env.DJ_SERVER_VERSION == env.DJ_UI_VERSION && env.DJ_SERVER_VERSION == env.DJ_CLIENT_PY_VERSION && env.DJ_SERVER_VERSION == env.DJ_CLIENT_JS_VERSION }}
run: |
echo "All versions match: ${DJ_SERVER_VERSION}"
echo "ALL_VERSIONS_MATCH=true" >> $GITHUB_ENV
- name: Fail on mismatch
if: ${{ env.ALL_VERSIONS_MATCH == 'false' }}
run: |
echo "Mismatched component versions found"
echo " - DJ Server: ${DJ_SERVER_VERSION}"
echo " - DJ Query: ${DJ_QUERY_VERSION}"
echo " - DJ Reflection: ${DJ_REFLECTION_VERSION}"
echo " - DJ UI: ${DJ_UI_VERSION}"
echo " - DJ Client for Python: ${DJ_CLIENT_PY_VERSION}"
echo " - DJ Client for Javascript: ${DJ_CLIENT_JS_VERSION}"
exit 1