Skip to content

Commit 8ed4daf

Browse files
Jiaxin FanJiaxin Fan
authored andcommitted
Rebase
1 parent c2887b2 commit 8ed4daf

File tree

7 files changed

+113
-218
lines changed

7 files changed

+113
-218
lines changed

.github/workflows/ci.yaml

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
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+
- name: Setup Java
55+
uses: actions/setup-java@v3
56+
with:
57+
distribution: 'temurin'
58+
java-version: '11'
59+
- name: Compile and Install Core OpenWhisk
60+
working-directory: core
61+
run: |
62+
./gradlew :tests:compileTestScala
63+
./gradlew install
64+
65+
# Build this repository
66+
- name: Build Runtime
67+
working-directory: runtime
68+
run: |
69+
./gradlew distDocker
70+
71+
# Test this repository
72+
- name: Test Runtime
73+
working-directory: runtime
74+
run: |
75+
./gradlew :tests:checkScalafmtAll
76+
./gradlew :tests:test
77+
78+
# Conditionally publish runtime images to DockerHub
79+
# Important: naming convention for release tags is runtime@version
80+
- name: Docker Login
81+
if: ${{ env.PUSH_NIGHTLY == 'true' || env.PUSH_RELEASE == 'true' }}
82+
uses: docker/login-action@v2
83+
with:
84+
username: ${{ secrets.DOCKERHUB_USER_OPENWHISK }}
85+
password: ${{ secrets.DOCKERHUB_TOKEN_OPENWHISK }}
86+
- name: Push Nightly Images
87+
if: ${{ env.PUSH_NIGHTLY == 'true' }}
88+
working-directory: runtime
89+
run: |
90+
SHORT_COMMIT=$(git rev-parse --short "$GITHUB_SHA")
91+
./gradlew :core:nodejs14Action:distDocker -PdockerRegistry=docker.io -PdockerImagePrefix=openwhisk -PdockerImageTag=nightly
92+
./gradlew :core:nodejs14Action:distDocker -PdockerRegistry=docker.io -PdockerImagePrefix=openwhisk -PdockerImageTag=$SHORT_COMMIT
93+
./gradlew :core:nodejs16Action:distDocker -PdockerRegistry=docker.io -PdockerImagePrefix=openwhisk -PdockerImageTag=nightly
94+
./gradlew :core:nodejs16Action:distDocker -PdockerRegistry=docker.io -PdockerImagePrefix=openwhisk -PdockerImageTag=$SHORT_COMMIT
95+
./gradlew :core:nodejs18Action:distDocker -PdockerRegistry=docker.io -PdockerImagePrefix=openwhisk -PdockerImageTag=nightly
96+
./gradlew :core:nodejs18Action:distDocker -PdockerRegistry=docker.io -PdockerImagePrefix=openwhisk -PdockerImageTag=$SHORT_COMMIT
97+
./gradlew :core:typescript37Action:distDocker -PdockerRegistry=docker.io -PdockerImagePrefix=openwhisk -PdockerImageTag=nightly
98+
./gradlew :core:typescript37Action:distDocker -PdockerRegistry=docker.io -PdockerImagePrefix=openwhisk -PdockerImageTag=$SHORT_COMMIT
99+
- name: Push Release Images
100+
if: ${{ env.PUSH_RELEASE == 'true' }}
101+
working-directory: runtime
102+
run: |
103+
RUNTIME_NAME=${GITHUB_REF_NAME%@*}
104+
IMAGE_TAG=${GITHUB_REF_NAME##*@}
105+
./gradlew :core:$RUNTIME_NAME:distDocker -PdockerRegistry=docker.io -PdockerImagePrefix=openwhisk -PdockerImageTag=$IMAGE_TAG

.travis.yml

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

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@
2020
# Apache OpenWhisk runtimes for Node.js
2121

2222
[![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0)
23-
[![Build Status](https://travis-ci.com/apache/openwhisk-runtime-nodejs.svg?branch=master)](https://travis-ci.com/github/apache/openwhisk-runtime-nodejs)
23+
[![Continuous Integration](https://github.com/apache/openwhisk-runtime-nodejs/actions/workflows/ci.yaml/badge.svg)](https://github.com/apache/openwhisk-runtime-nodejs/actions/workflows/ci.yaml)
2424

2525
This repository contains sources files needed to build the Node.js runtimes for Apache OpenWhisk. The build system will produce a series of docker images for each runtime version. These images are used in the platform to execute Node.js actions.
2626

2727
The following Node.js runtime versions (with kind & image labels) are generated by the build system:
2828

2929
- Node.js 14.19 (`nodejs:14` & `openwhisk/action-nodejs-v14`)
30-
- Node.js 16.15 (`nodejs:16` & `openwhisk/action-nodejs-v16`)
31-
- Node.js 18 (`nodejs:18` & `openwhisk/action-nodejs-v16`)
30+
- Node.js 16 (`nodejs:16` & `openwhisk/action-nodejs-v16`)
31+
- Node.js 18 (`nodejs:18` & `openwhisk/action-nodejs-v18`)
3232

3333
This README documents the build, customisation and testing of these runtime images.
3434

@@ -56,6 +56,7 @@ All the runtime images are published by the project to Docker Hub @ [https://hub
5656

5757
- [https://hub.docker.com/r/openwhisk/action-nodejs-v14](https://hub.docker.com/r/openwhisk/action-nodejs-v14)
5858
- [https://hub.docker.com/r/openwhisk/action-nodejs-v16](https://hub.docker.com/r/openwhisk/action-nodejs-v16)
59+
- [https://hub.docker.com/r/openwhisk/action-nodejs-v18](https://hub.docker.com/r/openwhisk/action-nodejs-v18)
5960

6061
These images can be used to execute Node.js actions on any deployment of Apache OpenWhisk, even those without those images defined the in runtime manifest, using the `--docker` action parameter.
6162

@@ -84,9 +85,10 @@ The `core/nodejsActionBase` folder contains the Node.js app server used to imple
8485
```
8586
./gradlew core:nodejs14Action:distDocker
8687
./gradlew core:nodejs16Action:distDocker
88+
./gradlew core:nodejs18Action:distDocker
8789
```
8890

89-
This will return the following runtime images with the following names: `action-nodejs-v14` and `action-nodejs-v16`.
91+
This will return the following runtime images with the following names: `action-nodejs-v14`, `action-nodejs-v16`, and `action-nodejs-v18`.
9092

9193
### Testing
9294

@@ -104,11 +106,11 @@ This will return the following runtime images with the following names: `action-
104106
```
105107
./gradlew tests:dat:docker:nodejs14docker:distDocker
106108
./gradlew tests:dat:docker:nodejs16docker:distDocker
109+
./gradlew tests:dat:docker:nodejs18docker:distDocker
107110
```
108111

109112
- Run the project tests.
110113

111114
```
112115
./gradlew :tests:test
113-
```
114-
An update about the details of verifying a standalone container can be found [here](https://github.com/apache/openwhisk-runtime-nodejs/tree/master/docs/users)
116+
```

tools/travis/build.sh

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

tools/travis/publish.sh

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

tools/travis/setup.sh

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

tools/travis/test.sh

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

0 commit comments

Comments
 (0)