-
Notifications
You must be signed in to change notification settings - Fork 14
169 lines (143 loc) · 4.76 KB
/
lint.yaml
File metadata and controls
169 lines (143 loc) · 4.76 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
name: Lint
on:
# Trigger the workflow on push or pull request,
# but only for the main branch
push:
branches:
- main
# Replace pull_request with pull_request_target if you
# plan to use this action with forks, see the Limitations section
pull_request:
types: [opened, synchronize, reopened]
branches:
- '**'
env:
MAVEN_OPTS: '-Xmx4G -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true -Drascal.compile.skip -Drascal.tutor.skip -Drascal.package.skip'
permissions:
checks: write
contents: write
jobs:
sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0 # sonar needs full checkout for better blame information
- uses: actions/setup-java@v5
with:
java-version: 17
distribution: 'temurin'
cache: 'maven'
- name: Cache SonarCloud packages
uses: actions/cache@v5
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Build, test and analyze java (also collect coverage data)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
working-directory: ./rascal-lsp
run: mvn -B -Pcoverage verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=usethesource_rascal-language-servers
eslint:
name: eslint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: setup node
uses: actions/setup-node@v6
with:
node-version: 20
cache: 'npm'
cache-dependency-path: rascal-vscode-extension/package-lock.json
registry-url: 'https://registry.npmjs.org'
- name: Package & compile extension
working-directory: ./rascal-vscode-extension
run: npm ci
- name: Run linters
uses: wearerequired/lint-action@v2
with:
eslint: true
eslint_dir: ./rascal-vscode-extension
eslint_args: "src"
eslint_extensions: ts
continue_on_error: false
checkstyle:
name: checkstyle
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
ref: ${{ github.event.pull_request.head.sha }} # run it on the PR, not on the merged commit, for better line numbers
- uses: actions/setup-java@v5
with:
java-version: 17
distribution: 'temurin'
cache: 'maven'
- name: Run checkstyle and print errors
run: mvn -B checkstyle:checkstyle checkstyle:check
working-directory: ./rascal-lsp
- name: Report build results
uses: gmazzo/publish-report-annotations@v1 # target latest major
if: ${{ !cancelled() }}
with:
testsSummary: off
reports: "rascal-lsp/target/checkstyle-result.xml"
githubql:
strategy:
matrix:
include:
- language: java
build-mode: manual
- language: typescript
build-mode: none
name: githubql
runs-on: ubuntu-latest
timeout-minutes: 360
permissions:
# required for all workflows
security-events: write
# required to fetch internal or private CodeQL packs
packages: read
# only required for workflows in private repositories
actions: read
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v6
- if: ${{ matrix.language == 'java' }}
uses: actions/setup-java@v5
with:
java-version: 17
distribution: 'temurin'
cache: 'maven'
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
- if: ${{ matrix.language == 'java' }}
name: Build java
run: mvn -B compile
working-directory: rascal-lsp/
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
with:
category: "/language:${{matrix.language}}"
checker-framework:
name: checker-framework
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Assure different pom cache hit
run: echo " " >> rascal-lsp/pom.xml
- uses: actions/setup-java@v5
with:
java-version: 11
distribution: 'temurin'
cache: 'maven'
- name: Run checkstyle and print errors
run: mvn -Pchecker-framework clean compile
working-directory: ./rascal-lsp