Skip to content
This repository was archived by the owner on Jul 1, 2025. It is now read-only.

Commit 49a49cc

Browse files
authored
[MINOR] Gradually migrate from travis to GitHub actions (#340)
*Major changes* - As Travis CI is discontinuing the free CI build for open source projects, we should migrate to Github actions, as suggested by ASF. (https://cwiki.apache.org/confluence/display/INFRA/Travis+Migrations) *Minor changes to note:* - None *Tests for the changes:* - Tested on [TEST] Github actions CI snuspl#8 *Other comments:* - None Closes #340
1 parent b07ac34 commit 49a49cc

File tree

6 files changed

+3541
-7095
lines changed

6 files changed

+3541
-7095
lines changed

.asf.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,18 @@ github:
2525
# strict means "Require branches to be up to date before merging".
2626
strict: true
2727
# contexts are the names of checks that must pass
28-
contexts: []
29-
# - gh-infra/jenkins
30-
# - another/build-that-must-pass
28+
contexts:
29+
- workflows/maven
30+
- workflows/node.js
3131

3232
required_pull_request_reviews:
3333
dismiss_stale_reviews: true
3434
required_approving_review_count: 1
3535

3636
# squash or rebase must be allowed in the repo for this setting to be set to true.
37-
required_linear_history: false
37+
required_linear_history: true
3838

3939
required_signatures: true
4040
branch_b:
4141
required_signatures: true
4242
del_branch_on_merge: true
43-

.github/workflows/maven.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
19+
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
20+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
21+
22+
# This workflow uses actions that are not certified by GitHub.
23+
# They are provided by a third-party and are governed by
24+
# separate terms of service, privacy policy, and support
25+
# documentation.
26+
27+
name: Java CI with Maven
28+
29+
on:
30+
push:
31+
branches: [ "master" ]
32+
pull_request:
33+
branches: [ "master" ]
34+
35+
jobs:
36+
build:
37+
strategy:
38+
matrix:
39+
java_version: ['11']
40+
os: [ubuntu-20.04, ubuntu-18.04]
41+
42+
name: Build on Java ${{ matrix.java_version }} and ${{ matrix.os }}
43+
runs-on: ${{ matrix.os }}
44+
45+
steps:
46+
- uses: actions/checkout@v3
47+
- name: Set up JDK ${{ matrix.java_version }}
48+
uses: actions/setup-java@v3
49+
with:
50+
java-version: ${{ matrix.java_version }}
51+
distribution: 'adopt'
52+
cache: maven
53+
- name: Build with Maven
54+
run: mvn -B verify --file pom.xml -q -ff -Dsurefire.useFile=false -Dorg.slf4j.simpleLogger.defaultLogLevel=info
55+
56+
# Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive
57+
- name: Update dependency graph
58+
uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6
59+

.github/workflows/node.js.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
19+
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
20+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
21+
22+
name: Node.js CI
23+
24+
on:
25+
push:
26+
branches: [ "master" ]
27+
pull_request:
28+
branches: [ "master" ]
29+
30+
jobs:
31+
build:
32+
strategy:
33+
matrix:
34+
node-version: [14.x, 16.x]
35+
os: [ubuntu-latest, ubuntu-18.04]
36+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
37+
runs-on: ${{ matrix.os }}
38+
39+
steps:
40+
- uses: actions/checkout@v3
41+
- name: Use Node.js ${{ matrix.node-version }}
42+
uses: actions/setup-node@v3
43+
with:
44+
node-version: ${{ matrix.node-version }}
45+
cache: 'npm'
46+
cache-dependency-path: webui/package-lock.json
47+
- run: pushd webui && npm ci && popd
48+
- run: pushd webui && npm run build --if-present && popd
49+
- run: pushd webui && npm test && popd

.github/workflows/sonarcloud.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
19+
# This workflow uses actions that are not certified by GitHub.
20+
# They are provided by a third-party and are governed by
21+
# separate terms of service, privacy policy, and support
22+
# documentation.
23+
24+
# This workflow helps you trigger a SonarCloud analysis of your code and populates
25+
# GitHub Code Scanning alerts with the vulnerabilities found.
26+
# Free for open source project.
27+
28+
# 1. Login to SonarCloud.io using your GitHub account
29+
#
30+
# 2. Import your project on SonarCloud
31+
# * Add your GitHub organization first, then add your repository as a new project.
32+
# * Please note that many languages are eligible for automatic analysis,
33+
# which means that the analysis will start automatically without the need to set up GitHub Actions.
34+
# * This behavior can be changed in Administration > Analysis Method.
35+
#
36+
# 3. Follow the SonarCloud in-product tutorial
37+
# * a. Copy/paste the Project Key and the Organization Key into the args parameter below
38+
# (You'll find this information in SonarCloud. Click on "Information" at the bottom left)
39+
#
40+
# * b. Generate a new token and add it to your Github repository's secrets using the name SONAR_TOKEN
41+
# (On SonarCloud, click on your avatar on top-right > My account > Security
42+
# or go directly to https://sonarcloud.io/account/security/)
43+
44+
# Feel free to take a look at our documentation (https://docs.sonarcloud.io/getting-started/github/)
45+
# or reach out to our community forum if you need some help (https://community.sonarsource.com/c/help/sc/9)
46+
47+
name: SonarCloud analysis
48+
49+
on:
50+
push:
51+
branches: [ "master" ]
52+
pull_request:
53+
branches: [ "master" ]
54+
workflow_dispatch:
55+
56+
permissions:
57+
pull-requests: read # allows SonarCloud to decorate PRs with analysis results
58+
59+
jobs:
60+
Analysis:
61+
runs-on: ubuntu-latest
62+
63+
steps:
64+
- name: Analyze with SonarCloud
65+
66+
# You can pin the exact commit or the version.
67+
uses: SonarSource/sonarcloud-github-action@de2e56b42aa84d0b1c5b622644ac17e505c9a049
68+
env:
69+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information
70+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} # Generate a token on Sonarcloud.io, add it to the secrets of this repo with the name SONAR_TOKEN (Settings > Secrets > Actions > add new repository secret)
71+
with:
72+
# Additional arguments for the sonarcloud scanner
73+
args:
74+
# Unique keys of your project and organization. You can find them in SonarCloud > Information (bottom-left menu)
75+
# mandatory
76+
-Dsonar.projectKey=org.apache.nemo:nemo-project
77+
-Dsonar.organization=apache
78+
# Comma-separated paths to directories containing main source files.
79+
# -Dsonar.sources= # optional, default is project base directory
80+
# When you need the analysis to take place in a directory other than the one from which it was launched
81+
# -Dsonar.projectBaseDir= # optional, default is .
82+
# Comma-separated paths to directories containing test source files.
83+
# -Dsonar.tests= # optional. For more info about Code Coverage, please refer to https://docs.sonarcloud.io/enriching/test-coverage/overview/
84+
# Adds more detail to both client and server-side analysis logs, activating DEBUG mode for the scanner, and adding client-side environment variables and system properties to the server-side log of analysis report processing.
85+
# -Dsonar.verbose= # optional, default is false

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Nemo
22

3+
[![Java CI with Maven](https://github.com/apache/incubator-nemo/actions/workflows/maven.yml/badge.svg)](https://github.com/apache/incubator-nemo/actions/workflows/maven.yml)
4+
[![Node.js CI](https://github.com/apache/incubator-nemo/actions/workflows/node.js.yml/badge.svg)](https://github.com/apache/incubator-nemo/actions/workflows/node.js.yml)
35
[![Build Status](https://app.travis-ci.com/apache/incubator-nemo.svg?branch=master)](https://app.travis-ci.com/apache/incubator-nemo)
46
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=org.apache.nemo%3Anemo-project&metric=alert_status)](https://sonarcloud.io/dashboard?id=org.apache.nemo%3Anemo-project)
57

0 commit comments

Comments
 (0)