diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..2eae9da --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,55 @@ +# Build + unit tests. Replaces the abandoned Travis config, which fetched a Maven +# distribution over the network with no integrity check (CWE-494). +# +# Rules for this file: +# * every third-party action is pinned by full commit SHA, never a mutable tag; +# * Maven comes from the runner image / setup-java, never an ad-hoc download; +# * `-C` makes Maven FAIL (not warn) on a checksum mismatch for any artifact. +name: Build + +on: + pull_request: + branches: ["master", "main"] + push: + branches: ["master", "main"] + +permissions: + contents: read + +jobs: + build: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + java: ['8', '11', '17'] + name: build (JDK ${{ matrix.java }}) + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + + - uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5.7.0 + with: + distribution: temurin + java-version: ${{ matrix.java }} + cache: maven + + # -C = strict checksum policy: a checksum mismatch on any resolved artifact + # fails the build instead of printing a warning. + # + # -DskipTests still COMPILES the tests (it only skips running them), so this + # job covers what CI can actually prove here: the enforcer rules, every pinned + # plugin version, and that main + test sources compile at source/target 1.7 on + # each JDK. + # + # The tests themselves are deliberately NOT run. They are credential-gated + # live-integration tests, not offline units: 12 of the 14 reach + # LocalBinary.getBinary(), which downloads the real BrowserStackLocal binary + # from an authenticated endpoint and returns HTTP 401 without + # BROWSERSTACK_ACCESS_KEY. A keyless runner therefore cannot pass them, and + # wiring a key in would both run real tunnels on every push and still fail for + # pull requests from forks (which get no secrets). + # + # To run the full suite locally: + # BROWSERSTACK_ACCESS_KEY=... BROWSERSTACK_USERNAME=... mvn -B -C test + - name: Build (compile, tests skipped - see above) + run: mvn -B -C -Dgpg.skip -DskipTests clean verify diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 7a7f809..0000000 --- a/.travis.yml +++ /dev/null @@ -1,23 +0,0 @@ -language: java - -addons: - apt: - packages: - - openjdk-6-jdk - -jdk: - - openjdk6 - - oraclejdk8 - - openjdk7 - - openjdk8 - -install: - - echo "Downloading Maven 3.0"; - - wget https://archive.apache.org/dist/maven/binaries/apache-maven-3.0-bin.zip || travis_terminate 1 - - unzip -qq apache-maven-3.0-bin.zip || travis_terminate 1 - - export M2_HOME=$PWD/apache-maven-3.0 - - export PATH=$M2_HOME/bin:$PATH - - mvn -version - - mvn clean package install -DskipTests -Dgpg.skip - -after_failure: cat /home/travis/build/browserstack/browserstack-local-java/target/surefire-reports/* diff --git a/README.md b/README.md index ea0369d..6f5b642 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ # browserstack-local-java -[![Build Status](https://travis-ci.org/browserstack/browserstack-local-java.svg?branch=master)](https://travis-ci.org/browserstack/browserstack-local-java) - Java bindings for BrowserStack Local. ## Installation diff --git a/pom.xml b/pom.xml index 25a77c2..7f34677 100644 --- a/pom.xml +++ b/pom.xml @@ -16,6 +16,13 @@ + + + UTF-8 + UTF-8 + + BrowserStack @@ -72,6 +79,7 @@ org.apache.maven.plugins maven-gpg-plugin + 3.2.8 sign-artifacts @@ -96,6 +104,7 @@ org.apache.maven.plugins maven-source-plugin + 3.4.0 attach-sources @@ -108,6 +117,7 @@ org.apache.maven.plugins maven-javadoc-plugin + 3.12.0 attach-javadocs @@ -126,6 +136,46 @@ + + + + + org.apache.maven.plugins + maven-clean-plugin + 3.5.0 + + + org.apache.maven.plugins + maven-resources-plugin + 3.5.0 + + + org.apache.maven.plugins + maven-jar-plugin + 3.5.1 + + + org.apache.maven.plugins + maven-install-plugin + 3.1.4 + + + org.apache.maven.plugins + maven-deploy-plugin + 3.1.4 + + + org.apache.maven.plugins + maven-site-plugin + 3.22.0 + + + org.sonatype.central @@ -138,10 +188,51 @@ false + + org.apache.maven.plugins + maven-enforcer-plugin + 3.6.3 + + + enforce-deterministic-dependencies + validate + + enforce + + + + + + false + false + false + false + + + No SNAPSHOT dependencies allowed. + + + + true + true + true + clean,deploy,site + + + true + + + + org.apache.maven.plugins maven-compiler-plugin - 2.3.2 + 3.14.1 1.7 1.7 @@ -150,7 +241,7 @@ org.apache.maven.plugins maven-surefire-plugin - 2.4.2 + 3.5.6