Skip to content

Commit f717619

Browse files
GitHub action (#5361)
* github action initial commit * fix blank * debug * fix push * fix java * add setup * triggering build * run unit test * ooops * updating debugAction * waitifdebug * fix cleanup * final test * disable ngrok * reworked the PR - multiple jobs and slack * split in multiple build * github actions updated * scancode fixes * forcing a corresponding version of jdk in ci and docker image and renaming S3_LOG_BUCKET to AWS_BUCKET to fix tests * more fixes - only one test failing against 1.0.0 * finally passing all the tests on 1.0.0 * restored master variables * restored more master files * triggered on push and pull request * unit test too * wskadmin fixes * improve message * dummy enabled * better git message * cleanup the log messages * unnecessary change to master - even if beneficial * improved messages (and a test disabled) * reverting commented test * get rid of DummyKO no more needed Co-authored-by: Michele Sciabarra <[email protected]>
1 parent a7ed8b5 commit f717619

25 files changed

+1274
-1
lines changed

.github/workflows/0-on-demand.yaml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
#
18+
name: On Demand Tests
19+
20+
on:
21+
workflow_dispatch:
22+
inputs:
23+
enable_ngrok_debug:
24+
description: "Enable Ngrok Debugging"
25+
required: true
26+
type: boolean
27+
default: false
28+
test_suite:
29+
description: Select Test Suite to run
30+
type: choice
31+
options:
32+
- Unit
33+
- System
34+
- MultiRuntime
35+
- Standalone
36+
- Scheduler
37+
- Performance
38+
- Dummy
39+
40+
env:
41+
# openwhisk env
42+
TEST_SUITE: ${{ inputs.test_suite }}
43+
ANSIBLE_CMD: "ansible-playbook -i environments/local -e docker_image_prefix=testing"
44+
GRADLE_PROJS_SKIP: ""
45+
46+
# (optional) slack incoming wehbook for notifications
47+
SLACK_WEBHOOK: ${{secrets.SLACK_WEBHOOK}}
48+
49+
# (optional) s3 log upload
50+
AWS_BUCKET: ${{ secrets.AWS_BUCKET }}
51+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
52+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
53+
AWS_REGION: ${{ secrets.AWS_REGION }}
54+
55+
# github
56+
GH_BUILD: ${{ github.event_name }}-${{ github.sha }}
57+
GH_BRANCH: ${{ github.head_ref || github.ref_name }}
58+
59+
# (optional) you need to add as secrets an ngrok token and a password to debug a build on demand
60+
NGROK_DEBUG: ${{ inputs.enable_ngrok_debug }}
61+
NGROK_TOKEN: ${{ secrets.NGROK_TOKEN }}
62+
NGROK_PASSWORD: ${{ secrets.NGROK_PASSWORD }}
63+
64+
jobs:
65+
openwhisk:
66+
runs-on: ubuntu-22.04
67+
steps:
68+
- name: Checkout
69+
uses: actions/checkout@v3
70+
- name: "Setup"
71+
run: ./tools/github/setup.sh
72+
- id: tests
73+
name: Run Tests
74+
run: "./tools/github/run${{ env.TEST_SUITE }}Tests.sh"
75+
continue-on-error: true
76+
- id: logs
77+
name: Upload Logs
78+
run: ./tools/github/checkAndUploadLogs.sh ${{ env.TEST_SUITE }}
79+
- name: Slack Notification
80+
run: >
81+
./tools/github/writeOnSlack.sh
82+
"[$TEST_SUITE]" ${{ steps.tests.outcome }} on ${GH_BUILD}
83+
$'\nbranch:' $GH_BRANCH
84+
$'\nmessage:' "$(git log -1 --oneline | cat)"
85+
$'\nlogs:' ${{ steps.logs.outputs.logs }}
86+
$'\nreport:' ${{ steps.logs.outputs.report }}
87+
- name: Debug Action (if requested)
88+
run: ./tools/github/debugAction.sh
89+
- name: Wait for Debug (if requested)
90+
run: ./tools/github/waitIfDebug.sh
91+
- name: Results
92+
run: test "${{ steps.tests.outcome }}" == "success"

.github/workflows/1-unit.yaml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
#
18+
name: Unit Tests
19+
20+
on:
21+
# build on push
22+
push:
23+
# build on pull requests
24+
pull_request:
25+
26+
env:
27+
# openwhisk env
28+
TEST_SUITE: Unit
29+
ANSIBLE_CMD: "ansible-playbook -i environments/local -e docker_image_prefix=testing"
30+
GRADLE_PROJS_SKIP: ""
31+
32+
## secrets
33+
# (optional) slack incoming wehbook for notifications
34+
SLACK_WEBHOOK: ${{secrets.SLACK_WEBHOOK}}
35+
36+
# (optional) s3 log upload
37+
AWS_BUCKET: ${{ secrets.AWS_BUCKET }}
38+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
39+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
40+
AWS_REGION: ${{ secrets.AWS_REGION }}
41+
42+
# github
43+
GH_BUILD: ${{ github.event_name }}-${{ github.sha }}
44+
GH_BRANCH: ${{ github.head_ref || github.ref_name }}
45+
46+
jobs:
47+
openwhisk:
48+
runs-on: ubuntu-22.04
49+
steps:
50+
- name: Checkout
51+
uses: actions/checkout@v3
52+
- name: "Setup"
53+
run: ./tools/github/setup.sh
54+
- id: tests
55+
name: Run Tests
56+
run: "./tools/github/run${{ env.TEST_SUITE }}Tests.sh"
57+
continue-on-error: true
58+
- id: logs
59+
name: Upload Logs
60+
run: ./tools/github/checkAndUploadLogs.sh ${{ env.TEST_SUITE }}
61+
- name: Slack Notification
62+
run: >
63+
./tools/github/writeOnSlack.sh
64+
"[$TEST_SUITE]" ${{ steps.tests.outcome }} on ${GH_BUILD}
65+
$'\nbranch:' $GH_BRANCH
66+
$'\nmessage:' "$(git log -1 --oneline | cat)"
67+
$'\nlogs:' ${{ steps.logs.outputs.logs }}
68+
$'\nreport:' ${{ steps.logs.outputs.report }}
69+
- name: Results
70+
run: test "${{ steps.tests.outcome }}" == "success"

.github/workflows/2-system.yaml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
#
18+
name: System Tests
19+
20+
on:
21+
# build on push
22+
push:
23+
# build on pull requests
24+
pull_request:
25+
26+
env:
27+
# openwhisk env
28+
TEST_SUITE: System
29+
ANSIBLE_CMD: "ansible-playbook -i environments/local -e docker_image_prefix=testing"
30+
GRADLE_PROJS_SKIP: ""
31+
32+
## secrets
33+
# (optional) slack incoming wehbook for notifications
34+
SLACK_WEBHOOK: ${{secrets.SLACK_WEBHOOK}}
35+
36+
# (optional) s3 log upload
37+
AWS_BUCKET: ${{ secrets.AWS_BUCKET }}
38+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
39+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
40+
AWS_REGION: ${{ secrets.AWS_REGION }}
41+
42+
# github
43+
GH_BUILD: ${{ github.event_name }}-${{ github.sha }}
44+
GH_BRANCH: ${{ github.head_ref || github.ref_name }}
45+
46+
jobs:
47+
openwhisk:
48+
runs-on: ubuntu-22.04
49+
steps:
50+
- name: Checkout
51+
uses: actions/checkout@v3
52+
- name: "Setup"
53+
run: ./tools/github/setup.sh
54+
- id: tests
55+
name: Run Tests
56+
run: "./tools/github/run${{ env.TEST_SUITE }}Tests.sh"
57+
continue-on-error: true
58+
- id: logs
59+
name: Upload Logs
60+
run: ./tools/github/checkAndUploadLogs.sh ${{ env.TEST_SUITE }}
61+
- name: Slack Notification
62+
run: >
63+
./tools/github/writeOnSlack.sh
64+
"[$TEST_SUITE]" ${{ steps.tests.outcome }} on ${GH_BUILD}
65+
$'\nbranch:' $GH_BRANCH
66+
$'\nmessage:' "$(git log -1 --oneline | cat)"
67+
$'\nlogs:' ${{ steps.logs.outputs.logs }}
68+
$'\nreport:' ${{ steps.logs.outputs.report }}
69+
- name: Results
70+
run: test "${{ steps.tests.outcome }}" == "success"
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
#
18+
name: MultiRuntime Tests
19+
20+
on:
21+
# build on push
22+
push:
23+
# build on pull requests
24+
pull_request:
25+
26+
env:
27+
# openwhisk env
28+
TEST_SUITE: MultiRuntime
29+
ANSIBLE_CMD: "ansible-playbook -i environments/local -e docker_image_prefix=testing"
30+
GRADLE_PROJS_SKIP: ""
31+
32+
## secrets
33+
# (optional) slack incoming wehbook for notifications
34+
SLACK_WEBHOOK: ${{secrets.SLACK_WEBHOOK}}
35+
36+
# (optional) s3 log upload
37+
AWS_BUCKET: ${{ secrets.AWS_BUCKET }}
38+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
39+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
40+
AWS_REGION: ${{ secrets.AWS_REGION }}
41+
42+
# github
43+
GH_BUILD: ${{ github.event_name }}-${{ github.sha }}
44+
GH_BRANCH: ${{ github.head_ref || github.ref_name }}
45+
46+
jobs:
47+
openwhisk:
48+
runs-on: ubuntu-22.04
49+
steps:
50+
- name: Checkout
51+
uses: actions/checkout@v3
52+
- name: "Setup"
53+
run: ./tools/github/setup.sh
54+
- id: tests
55+
name: Run Tests
56+
run: "./tools/github/run${{ env.TEST_SUITE }}Tests.sh"
57+
continue-on-error: true
58+
- id: logs
59+
name: Upload Logs
60+
run: ./tools/github/checkAndUploadLogs.sh ${{ env.TEST_SUITE }}
61+
- name: Slack Notification
62+
run: >
63+
./tools/github/writeOnSlack.sh
64+
"[$TEST_SUITE]" ${{ steps.tests.outcome }} on ${GH_BUILD}
65+
$'\nbranch:' $GH_BRANCH
66+
$'\nmessage:' "$(git log -1 --oneline | cat)"
67+
$'\nlogs:' ${{ steps.logs.outputs.logs }}
68+
$'\nreport:' ${{ steps.logs.outputs.report }}
69+
- name: Results
70+
run: test "${{ steps.tests.outcome }}" == "success"

.github/workflows/4-standalone.yaml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
#
18+
name: Standalone Tests
19+
20+
on:
21+
# build on push
22+
push:
23+
# build on pull requests
24+
pull_request:
25+
26+
env:
27+
# openwhisk env
28+
TEST_SUITE: Standalone
29+
ANSIBLE_CMD: "ansible-playbook -i environments/local -e docker_image_prefix=testing"
30+
GRADLE_PROJS_SKIP: ""
31+
32+
## secrets
33+
# (optional) slack incoming wehbook for notifications
34+
SLACK_WEBHOOK: ${{secrets.SLACK_WEBHOOK}}
35+
36+
# (optional) s3 log upload
37+
AWS_BUCKET: ${{ secrets.AWS_BUCKET }}
38+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
39+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
40+
AWS_REGION: ${{ secrets.AWS_REGION }}
41+
42+
# github
43+
GH_BUILD: ${{ github.event_name }}-${{ github.sha }}
44+
GH_BRANCH: ${{ github.head_ref || github.ref_name }}
45+
46+
jobs:
47+
openwhisk:
48+
runs-on: ubuntu-22.04
49+
steps:
50+
- name: Checkout
51+
uses: actions/checkout@v3
52+
- name: "Setup"
53+
run: ./tools/github/setup.sh
54+
- id: tests
55+
name: Run Tests
56+
run: "./tools/github/run${{ env.TEST_SUITE }}Tests.sh"
57+
continue-on-error: true
58+
- id: logs
59+
name: Upload Logs
60+
run: ./tools/github/checkAndUploadLogs.sh ${{ env.TEST_SUITE }}
61+
- name: Slack Notification
62+
run: >
63+
./tools/github/writeOnSlack.sh
64+
"[$TEST_SUITE]" ${{ steps.tests.outcome }} on ${GH_BUILD}
65+
$'\nbranch:' $GH_BRANCH
66+
$'\nmessage:' "$(git log -1 --oneline | cat)"
67+
$'\nlogs:' ${{ steps.logs.outputs.logs }}
68+
$'\nreport:' ${{ steps.logs.outputs.report }}
69+
- name: Results
70+
run: test "${{ steps.tests.outcome }}" == "success"

0 commit comments

Comments
 (0)