forked from apache/daffodil-vscode
-
Notifications
You must be signed in to change notification settings - Fork 0
183 lines (157 loc) · 5.72 KB
/
CI.yml
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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
---
name: CI
on:
push:
branches-ignore: [ 'dependabot/**' ]
pull_request:
types: [opened, synchronize, reopened]
jobs:
single-commit:
name: Single Commit Pull Request
if: github.event_name == 'pull_request'
runs-on: ubuntu-20.04
steps:
- name: Check Single Commit
uses: actions/[email protected]
with:
script: |
const commits = await github.rest.pulls.listCommits({
...context.repo,
pull_number: context.issue.number,
});
core.info("Number of commits in this pull request: " + commits.data.length);
if (commits.data.length > 1) {
core.setFailed("If approved with two +1's, squash this pull request into one commit");
}
code-format:
name: TypeScript/Scala/Svelte Formatting
strategy:
matrix:
java_distribution: [ temurin ]
java_version: [ 8 ]
os: [ ubuntu-20.04 ]
node: [ '16' ]
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
env:
SBT: sbt -J-Xms1024m -J-Xmx5120m -J-XX:ReservedCodeCacheSize=512m -J-XX:MaxMetaspaceSize=1024m ++2.12.15
steps:
############################################################
# Setup
############################################################
- name: Check out Repository
uses: actions/[email protected]
- name: Setup Java
uses: actions/[email protected]
with:
distribution: ${{ matrix.java_distribution }}
java-version: ${{ matrix.java_version }}
- name: Install Node.js
uses: actions/[email protected]
with:
node-version: ${{ matrix.node }}
############################################################
# Lint/format checks
############################################################
- name: Scala format check
run: $SBT scalafmtCheck
- name: Scala sbt format check
run: $SBT scalafmtSbtCheck
- name: Install node dependencies
run: yarn install
- name: TypeScript lint
run: yarn lint
rat-check:
name: Rat Check
strategy:
matrix:
java_distribution: [ temurin ]
java_version: [ 8 ]
os: [ ubuntu-20.04 ]
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
env:
SBT: sbt -J-Xms1024m -J-Xmx5120m -J-XX:ReservedCodeCacheSize=512m -J-XX:MaxMetaspaceSize=1024m ++2.12.15
steps:
############################################################
# Setup
############################################################
- name: Check out Repository
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Setup Java
uses: actions/[email protected]
with:
distribution: ${{ matrix.java_distribution }}
java-version: ${{ matrix.java_version }}
############################################################
# Rat check
############################################################
- name: Run Rat Check
run: $SBT ratCheck || (cat target/rat.txt; exit 1)
build-test-package:
name: 'Build, Test, and Package (OS: ${{ matrix.os }}, Node: ${{ matrix.node }}, Java: ${{ matrix.java_version }})'
strategy:
matrix:
java_distribution: [ temurin ]
java_version: [ 8, 11, 17 ]
os: [ macos-12, ubuntu-20.04, windows-2019 ]
node: [ '16', '18.20.1' ] # version 18.20.2 (current latest of 18) is broken on windows
vscode: [ '1.91.1' ]
fail-fast: false # don't immediately fail all other jobs if a single job fails
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
env:
DAFFODIL_TEST_VSCODE_VERSION: ${{ matrix.vscode }}
steps:
############################################################
# Setup
############################################################
- name: Check out Repository
uses: actions/[email protected]
- name: Setup Java
uses: actions/[email protected]
with:
distribution: ${{ matrix.java_distribution }}
java-version: ${{ matrix.java_version }}
- name: Install Node.js
uses: actions/[email protected]
with:
node-version: ${{ matrix.node }}
############################################################
# Build & Package
############################################################
- name: Install node dependencies
run: yarn install
- name: Runs tests - Linux
run: xvfb-run -a yarn test
if: runner.os == 'Linux'
- name: Runs tests - Windows/Mac
run: yarn test
if: runner.os != 'Linux'
- name: Check for Errors in macOS
run: tail -n 1000 '/Users/runner/Library/Application Support/omega_edit/'* && exit 1
if: failure() && runner.os == 'macOS'
- name: Package
run: yarn package