Skip to content

Commit

Permalink
[testing] replace travis CI tests with Github Action flows
Browse files Browse the repository at this point in the history
  • Loading branch information
wgtdkp committed Jan 25, 2022
1 parent eb8122a commit f3fc4ce
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 86 deletions.
28 changes: 22 additions & 6 deletions .travis/before_install.sh → .github/workflows/build.yml
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/bin/bash
#
# Copyright (c) 2020, The OpenThread Registrar Authors.
# All rights reserved.
Expand Down Expand Up @@ -27,10 +26,27 @@
# POSSIBILITY OF SUCH DAMAGE.
#

set -e
name: Build

if [ "${TRAVIS_OS_NAME}" == "linux" ]; then
sudo /sbin/sysctl -w net.ipv6.conf.lo.disable_ipv6=0
fi
on: [push, pull_request]

./script/bootstrap.sh
jobs:

cancel-previous-runs:
runs-on: ubuntu-latest
steps:
- uses: rokroskar/workflow-run-cleanup-action@master
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
if: "github.ref != 'refs/heads/main'"

package-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Bootstrap
run: script/bootstrap.sh
- name: Package
run: mvn package -Dmaven.test.skip=true
- name: Test
run: mvn test
38 changes: 0 additions & 38 deletions .travis.yml

This file was deleted.

32 changes: 0 additions & 32 deletions .travis/script.sh

This file was deleted.

13 changes: 5 additions & 8 deletions script/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@

set -e

ACE_REPO=https://bitbucket.org/marco-tiloca-sics/ace-java

## Test if we has the given command.
## Args: $1, the command.
has_command() {
Expand Down Expand Up @@ -62,13 +60,12 @@ install_toolchain() {
}

install_ace() {
if [ ! -d ace ]; then
git clone $ACE_REPO ace
fi
cd ace
mvn -DskipTests install
cd /tmp
if [ ! -f ace ]; then
wget --inet4-only https://bitbucket.org/wgtdkp/ace-java/downloads/ace-0.0.1-SNAPSHOT-be8c6ee9.jar
mvn org.apache.maven.plugins:maven-install-plugin:2.5.2:install-file -Dfile=ace-0.0.1-SNAPSHOT-be8c6ee9.jar
fi
cd -
rm -rf ace
}

install_toolchain
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/com/google/openthread/LoggerInitializer.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

import ch.qos.logback.classic.Level;
import ch.qos.logback.classic.Logger;
import org.apache.logging.log4j.core.config.Configurator;
import org.slf4j.LoggerFactory;

public class LoggerInitializer {
Expand All @@ -40,10 +41,10 @@ public class LoggerInitializer {
public static void Init(boolean verbose) {
if (verbose) {
((Logger) LoggerFactory.getLogger(CALIFORNIUM)).setLevel(Level.DEBUG);
org.apache.log4j.Logger.getLogger(OPENTHREAD).setLevel(org.apache.log4j.Level.DEBUG);
Configurator.setLevel(OPENTHREAD, org.apache.logging.log4j.Level.DEBUG);
} else {
((Logger) LoggerFactory.getLogger(CALIFORNIUM)).setLevel(Level.INFO);
org.apache.log4j.Logger.getLogger(OPENTHREAD).setLevel(org.apache.log4j.Level.INFO);
Configurator.setLevel(OPENTHREAD, org.apache.logging.log4j.Level.INFO);
}
}
}

0 comments on commit f3fc4ce

Please sign in to comment.