-
Notifications
You must be signed in to change notification settings - Fork 65
53 lines (51 loc) · 1.72 KB
/
lint.yaml
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
51
52
53
name: Java Lint CI
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@128a63446a954579617e875aaab7d2978154e969 # v2.4.0
with:
disable-sudo: true
egress-policy: block
allowed-endpoints: >
github.com:443
repo.maven.apache.org:443
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- name: Set up JDK
uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2 # v3.11.0
with:
java-version: 11.x
distribution: temurin
- name: Build API with Maven
run: (cd functions-framework-api/ && mvn install)
- name: Lint Functions Framework API
run: (cd functions-framework-api/ && mvn clean verify -DskipTests -P lint)
- name: Build Invoker with Maven
run: (cd functions-framework-api/ && mvn install)
- name: Lint Invoker
run: (cd invoker/ && mvn clean verify -DskipTests -P lint)
formatting:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@128a63446a954579617e875aaab7d2978154e969 # v2.4.0
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 # v2 minimum required
- name: Run formatter
id: formatter
uses: axel-op/googlejavaformat-action@dbff853fb823671ec5781365233bf86543b13215 # v3
with:
args: "--replace"
skip-commit: true
- name: Print diffs
run: git --no-pager diff --exit-code