mirror of https://github.com/jwtk/jjwt.git
enable GitHub Actions
https://arstechnica.com/information-technology/2021/09/travis-ci-flaw-exposed-secrets-for-thousands-of-open-source-projects/
This commit is contained in:
parent
2fb6d6bb9c
commit
aa17d5094e
|
@ -0,0 +1,31 @@
|
||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
java: [ '7', '8', '11' ]
|
||||||
|
runs-on: 'ubuntu-latest'
|
||||||
|
env:
|
||||||
|
MVN_CMD: ./mvnw --no-transfer-progress -B
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Set up JDK
|
||||||
|
uses: actions/setup-java@v2
|
||||||
|
with:
|
||||||
|
java-version: ${{ matrix.java }}
|
||||||
|
distribution: 'zulu'
|
||||||
|
cache: 'maven'
|
||||||
|
- name: Build
|
||||||
|
run: ${{env.MVN_CMD}} clean install
|
||||||
|
- name: Code coverage
|
||||||
|
if: ${{matrix.java}} != '7'
|
||||||
|
run: ${{env.MVN_CMD}} clean clover:setup test && ${{env.MVN_CMD}} -pl . clover:clover clover:check coveralls:report;
|
48
.travis.yml
48
.travis.yml
|
@ -1,48 +0,0 @@
|
||||||
# https://travis-ci.org/jwtk/jjwt
|
|
||||||
|
|
||||||
#sudo: required
|
|
||||||
dist: trusty
|
|
||||||
language: java
|
|
||||||
jdk:
|
|
||||||
- openjdk7 # not really openjdk7 - we're just using this travis placeholder for our own Oracle JDK 7 installation
|
|
||||||
- oraclejdk8
|
|
||||||
- oraclejdk9
|
|
||||||
- openjdk10
|
|
||||||
- openjdk11
|
|
||||||
- openjdk14
|
|
||||||
|
|
||||||
cache:
|
|
||||||
directories:
|
|
||||||
- $HOME/.m2
|
|
||||||
|
|
||||||
before_install:
|
|
||||||
- echo "TRAVIS_JDK_VERSION is ${TRAVIS_JDK_VERSION}"
|
|
||||||
- export MVN_CMD="./mvnw --no-transfer-progress" # hide verbose download messages (log spam)
|
|
||||||
- |
|
|
||||||
if [[ "${TRAVIS_JDK_VERSION}" == "openjdk7" ]]; then
|
|
||||||
|
|
||||||
export MAVEN_OPTS="-Dhttps.protocols=TLSv1.2 -Xmx512m -XX:MaxPermSize=128m"
|
|
||||||
export JAVA_HOME="/usr/lib/jvm/java-7-oracle" # Set JAVA_HOME to where we want to install Oracle JDK 7
|
|
||||||
export PATH="${JAVA_HOME}/bin:${PATH}"
|
|
||||||
|
|
||||||
if [[ ! -d "${JAVA_HOME}" ]]; then
|
|
||||||
# Download and install Oracle JDK 7:
|
|
||||||
wget https://238dj3282as03k369.s3-us-west-1.amazonaws.com/jdk-7u80-linux-x64.tar.gz -O /tmp/jdk-7u80-linux-x64.tar.gz
|
|
||||||
tar xvfz /tmp/jdk-7u80-linux-x64.tar.gz -C /tmp
|
|
||||||
sudo mv /tmp/jdk1.7.0_80 "${JAVA_HOME}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Download and install JCE Unlimited Strength Crypto policies for Oracle JDK 7:
|
|
||||||
curl -q -L -C - https://238dj3282as03k369.s3-us-west-1.amazonaws.com/UnlimitedJCEPolicyJDK7.zip -o /tmp/UnlimitedJCEPolicyJDK7.zip
|
|
||||||
sudo unzip -oj -d "$JAVA_HOME/jre/lib/security" /tmp/UnlimitedJCEPolicyJDK7.zip \*/\*.jar
|
|
||||||
rm /tmp/UnlimitedJCEPolicyJDK7.zip
|
|
||||||
fi
|
|
||||||
# If on JDK 8, ensure build coverage assertions are run (we only need to run this on one JDK to reduce overall build times):
|
|
||||||
- export BUILD_COVERAGE="$([ $TRAVIS_JDK_VERSION == 'oraclejdk8' ] && echo 'true')"
|
|
||||||
|
|
||||||
# prints the Maven, Java, and OS info/version
|
|
||||||
install: $MVN_CMD --version
|
|
||||||
|
|
||||||
script:
|
|
||||||
- $MVN_CMD install
|
|
||||||
- test -z "$BUILD_COVERAGE" || { $MVN_CMD clean clover:setup test && $MVN_CMD -pl . clover:clover clover:check coveralls:report; }
|
|
Loading…
Reference in New Issue