# This workflow builds and unit tests both main Java API and also build/data tools for metadata generation. name: Testing Java API on: pull_request permissions: contents: read jobs: java-test: runs-on: ubuntu-latest steps: - name: Harden Runner uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0 with: egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - name: Set up JDK 8 and Maven uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e # v5.1.0 with: java-version: '8' distribution: 'adopt' # Invoke the "github-actions" profile during Maven steps; see in pom.xml # files. This is configured not to build the "cpp-build" module. # The "mvn install" command will run by default during the "install" phase by # Github Actions, without the profile flag. Here we customize the install phase to # use the relevant profile. If we want to build "cpp-build" with Github Action CI # it's safe to remove the first line entirely. - name: Test Build Tools with Maven run: | mvn install -P github-actions -DskipTests=true -Dmaven.javadoc.skip=true -B -V mvn -P github-actions test - name: Test Java API with Ant run: | ant clean -f java/build.xml ant jar -f java/build.xml ant junit -f java/build.xml js-files-ascii-check: runs-on: ubuntu-latest steps: - name: Harden Runner uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0 with: egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - name: Install ascii-safe-cli run: npm install -g is-ascii-safe-cli - name: Check whether .js api files are ascii safe or not. run: find . -name '*.js' ! -name '*_test.js' | xargs is-ascii-safe