Skip to content

Commit ee7e622

Browse files
authored
Github action for docker runtime (#99)
1 parent 6fb9881 commit ee7e622

9 files changed

Lines changed: 134 additions & 297 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
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+
19+
name: Continuous Integration
20+
21+
on:
22+
push:
23+
branches: [ master ]
24+
tags: [ '*' ]
25+
pull_request:
26+
branches: [ master ]
27+
types: [ opened, synchronize, reopened ]
28+
schedule:
29+
- cron: '30 1 * * 1,3,5'
30+
31+
permissions: read-all
32+
33+
jobs:
34+
ci:
35+
runs-on: ubuntu-22.04
36+
env:
37+
PUSH_NIGHTLY: ${{ (github.event_name == 'push' || github.event_name == 'schedule') && github.ref == 'refs/heads/master' }}
38+
PUSH_RELEASE: ${{ github.event_name == 'push' && github.ref_type == 'tag' }}
39+
steps:
40+
# Checkout just this repo and run scanCode before we do anything else
41+
- name: Checkout runtime repo
42+
uses: actions/checkout@v3
43+
with:
44+
path: runtime
45+
- name: Scan Code
46+
uses: apache/openwhisk-utilities/scancode@master
47+
48+
# Install core OpenWhisk artifacts needed to build/test anything else
49+
- name: Checkout OpenWhisk core repo
50+
uses: actions/checkout@v3
51+
with:
52+
repository: apache/openwhisk
53+
path: core
54+
55+
- name: Checkout OpenWhisk Utilities repo
56+
uses: actions/checkout@v3
57+
with:
58+
repository: apache/openwhisk-utilities
59+
path: utilities
60+
61+
- name: Setup Java
62+
uses: actions/setup-java@v3
63+
with:
64+
distribution: 'temurin'
65+
java-version: '11'
66+
67+
- name: Setup OpenWhisk
68+
working-directory: core
69+
run: |
70+
./tools/travis/setup.sh
71+
72+
# run scancode using the ASF Release configuration
73+
- name: Setup
74+
working-directory: utilities
75+
run: |
76+
scancode/scanCode.py --config scancode/ASF-Release.cfg ../runtime
77+
78+
- name: Compile and Install Core OpenWhisk
79+
working-directory: core
80+
run: |
81+
./gradlew install tests:buildArtifacts
82+
export OPENWHISK_HOME=$(pwd)
83+
echo "openwhisk.home=$OPENWHISK_HOME" > whisk.properties
84+
echo "vcap.services.file=" >> whisk.properties
85+
86+
# Build this repository
87+
- name: Build Runtime && SDK
88+
working-directory: runtime
89+
run: |
90+
./gradlew distDocker
91+
./sdk/docker/build_tgz.sh blackbox.tar.gz
92+
93+
# Test this repository
94+
- name: Test Runtime
95+
working-directory: runtime
96+
run: |
97+
export OPENWHISK_HOME="$(pwd)/../core"
98+
./gradlew :tests:checkScalafmtAll
99+
./gradlew :tests:test
100+
101+
# Conditionally publish runtime images to DockerHub
102+
# Important: naming convention for release tags is runtime@version
103+
- name: Docker Login
104+
if: ${{ env.PUSH_NIGHTLY == 'true' || env.PUSH_RELEASE == 'true' }}
105+
uses: docker/login-action@v2
106+
with:
107+
username: ${{ secrets.DOCKERHUB_USER_OPENWHISK }}
108+
password: ${{ secrets.DOCKERHUB_TOKEN_OPENWHISK }}
109+
- name: Push Nightly Images
110+
if: ${{ env.PUSH_NIGHTLY == 'true' }}
111+
working-directory: runtime
112+
run: |
113+
SHORT_COMMIT=$(git rev-parse --short "$GITHUB_SHA")
114+
./gradlew :core:actionProxy:distDocker -PdockerRegistry=docker.io -PdockerImagePrefix=openwhisk -PdockerImageTag=nightly
115+
./gradlew :core:actionProxy:distDocker -PdockerRegistry=docker.io -PdockerImagePrefix=openwhisk -PdockerImageTag=$SHORT_COMMIT
116+
./gradlew :sdk:docker:distDocker -PdockerRegistry=docker.io -PdockerImagePrefix=openwhisk -PdockerImageTag=nightly
117+
./gradlew :sdk:docker:distDocker -PdockerRegistry=docker.io -PdockerImagePrefix=openwhisk -PdockerImageTag=$SHORT_COMMIT
118+
- name: Push Release Images
119+
if: ${{ env.PUSH_RELEASE == 'true' }}
120+
working-directory: runtime
121+
run: |
122+
IMAGE_TAG=${GITHUB_REF_NAME##*@}
123+
SHORT_COMMIT=$(git rev-parse --short "$GITHUB_SHA")
124+
GRADLE_BUILD=":core:actionProxy:distDocker"
125+
126+
if [ ${IMAGE_NAME} == "dockerskeleton" ]; then
127+
GRADLE_BUILD=":core:actionProxy:distDocker"
128+
elif [ ${IMAGE_NAME} == "example" ]; then
129+
GRADLE_BUILD=":sdk:docker:distDocker"
130+
fi
131+
132+
./gradlew ${GRADLE_BUILD} -PdockerRegistry=docker.io -PdockerImagePrefix=openwhisk -PdockerImageTag=$IMAGE_TAG
133+
./gradlew ${GRADLE_BUILD} -PdockerRegistry=docker.io -PdockerImagePrefix=openwhisk -PdockerImageTag=$SHORT_COMMIT

.travis.yml

Lines changed: 0 additions & 66 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
# Apache OpenWhisk runtimes for docker
2121
[![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0)
22-
[![Build Status](https://travis-ci.com/apache/openwhisk-runtime-docker.svg?branch=master)](https://travis-ci.com/github/apache/openwhisk-runtime-docker)
22+
[![Continuous Integration](https://github.com/apache/openwhisk-runtime-docker/actions/workflows/ci.yaml/badge.svg)](https://github.com/apache/openwhisk-runtime-docker/actions/workflows/ci.yaml)
2323

2424

2525
### Give it a try today

tools/travis/build.sh

Lines changed: 0 additions & 43 deletions
This file was deleted.

tools/travis/build_sdk.sh

Lines changed: 0 additions & 27 deletions
This file was deleted.

tools/travis/publish.sh

Lines changed: 0 additions & 61 deletions
This file was deleted.

tools/travis/rename_sdk.sh

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)