File: java-unit-test.yml

package info (click to toggle)
libphonenumber 8.13.51%2Bds-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 108,244 kB
  • sloc: cpp: 53,546; xml: 50,081; java: 33,392; javascript: 31,267; ansic: 482; jsp: 228; sh: 62; makefile: 33
file content (50 lines) | stat: -rw-r--r-- 2,064 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# 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@8ca2b8b2ece13480cda6dacd3511b49857a23c09 # v2.5.1
      with:
        egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

    - uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
    - name: Set up JDK 8 and Maven
      uses: actions/setup-java@cd89f46ac9d01407894225f350157564c9c7cee2 # v3.12.0
      with:
        java-version: '8'
        distribution: 'adopt'
# Invoke the "github-actions" profile during Maven steps; see <profile> 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@8ca2b8b2ece13480cda6dacd3511b49857a23c09 # v2.5.1
      with:
        egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

    - uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
    - 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