-
Notifications
You must be signed in to change notification settings - Fork 0
171 lines (162 loc) · 6.04 KB
/
main.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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
name: Workflows CI
on:
push:
branches: [ dev, staging, test, release-** ]
pull_request:
branches: [ dev, staging, test, release-** ]
jobs:
Run_Engine_Tests:
name: Run_Engine_Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup_Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: PIP_Install
run: "pip install -r ./src/engine/src/requirements.txt"
- name: OWE_Python_SDK_Tests
run: ./src/engine/src/owe_python_sdk/tests/run.sh
- name: OWE_Engine_Tests
run: ./src/engine/src/tests/run.sh
Run_API_Tests:
name: Run_API_Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup_Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: PIP_Install
run: "pip install -r ./src/api/src/requirements.txt"
- name: Run_API_Tests
run: echo "FIXME - Need to figure out why tests not running -- ./src/api/src/tests/run.sh"
Run_Engine_Streams_Tests:
name: Run_Engine_Streams_Tests
runs-on: ubuntu-latest
steps:
- run: "echo 'Running Engine Streams Tests'"
Resolve_Image_Tag:
runs-on: ubuntu-latest
outputs:
image_tag: ${{ steps.set_image_tag.outputs.image_tag }}
steps:
- name: Extract_Branch_Name
# Map a step output to a job output
shell: bash
run: echo "branch_name=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
id: extract_branch
- name: Check_Is_Production_Release
id: check_is_production_release
shell: bash
run: |
if [ "${{ contains(steps.extract_branch.outputs.branch_name, 'release-') }}" = true ]; then
echo "is_production_release=true" >> $GITHUB_OUTPUT;
else
echo "is_production_release=false" >> $GITHUB_OUTPUT;
fi
- name: Extract Production Release Version
if: ${{ steps.check_is_production_release.outputs.is_production_release == 'true' }}
shell: bash
run: echo version=$(echo ${{ steps.extract_branch.outputs.branch_name }} | sed -e 's!release-!!') >> $GITHUB_OUTPUT
id: extract_version
- name: Extract_Image_Tag
shell: bash
run: |
if [ "${{ steps.check_is_production_release.outputs.is_production_release }}" == true ]; then
echo "image_tag=${{ steps.extract_version.outputs.version }}" >> $GITHUB_OUTPUT;
else
echo "image_tag=${{ steps.extract_branch.outputs.branch_name }}" >> $GITHUB_OUTPUT;
fi
id: set_image_tag
Build_Push_Image_Api:
needs:
- Resolve_Image_Tag
- Run_API_Tests
runs-on: ubuntu-latest
name: Build_Push_Api_Image
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.TAPIS_DOCKERHUB_USERNAME }}
password: ${{ secrets.TAPIS_DOCKERHUB_ACCESS_TOKEN }}
- name: Build_Tapis_Workflows_Api_Image
run: |
BRANCH="${{ needs.Resolve_Image_Tag.outputs.image_tag }}"
if [ "${{ contains(needs.Resolve_Image_Tag.outputs.image_tag, 'refs/pull/') }}" == true ]; then
BRANCH=dev
fi
docker build -f src/api/src/Dockerfile -t tapis/workflows-api:$BRANCH .
- name: Push_All_Tags
run: docker push --all-tags tapis/workflows-api
Build_Push_Image_Engine:
needs:
- Resolve_Image_Tag
- Run_Engine_Tests
runs-on: ubuntu-latest
name: Build_Push_Engine_Image
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.TAPIS_DOCKERHUB_USERNAME }}
password: ${{ secrets.TAPIS_DOCKERHUB_ACCESS_TOKEN }}
- name: Build_Tapis_Workflows_Engine_Image
run: |
BRANCH="${{ needs.Resolve_Image_Tag.outputs.image_tag }}"
if [ "${{ contains(needs.Resolve_Image_Tag.outputs.image_tag, 'refs/pull/') }}" == true ]; then
BRANCH=dev
fi
docker build -f src/engine/src/Dockerfile -t tapis/workflows-pipelines:$BRANCH .
- name: Push_All_Tags
run: docker push --all-tags tapis/workflows-pipelines
Build_Push_Image_Engine_Streams:
needs:
- Resolve_Image_Tag
- Run_Engine_Streams_Tests
runs-on: ubuntu-latest
name: Build_Push_Engine_Streams_Image
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.TAPIS_DOCKERHUB_USERNAME }}
password: ${{ secrets.TAPIS_DOCKERHUB_ACCESS_TOKEN }}
- name: Build_Tapis_Workflows_Engine_Streams_Image
run: |
BRANCH="${{ needs.Resolve_Image_Tag.outputs.image_tag }}"
if [ "${{ contains(needs.Resolve_Image_Tag.outputs.image_tag, 'refs/pull/') }}" == true ]; then
BRANCH=dev
fi
docker build -f src/engine-streams/src/Dockerfile -t tapis/workflow-engine-streams:$BRANCH .
- name: Push_All_Tags
run: docker push --all-tags tapis/workflow-engine-streams
Build_Push_Image_Python_Singularity:
needs:
- Resolve_Image_Tag
runs-on: ubuntu-latest
name: Build_Push_Python_Sinuglarity_Image
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.TAPIS_DOCKERHUB_USERNAME }}
password: ${{ secrets.TAPIS_DOCKERHUB_ACCESS_TOKEN }}
- name: Build_Tapis_Python_Singularity_Image
run: |
docker build -f src/engine/src/contrib/tapis/images/python-singularity/Dockerfile -t tapis/workflows-python-singularity:0.1.0 src/engine/src/contrib/tapis/images/python-singularity
- name: Push_All_Tags
run: docker push --all-tags tapis/workflows-python-singularity