-
Notifications
You must be signed in to change notification settings - Fork 8
140 lines (117 loc) · 3.57 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
name: CI
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches:
- 'main'
pull_request:
branches:
- 'main'
permissions: {}
jobs:
build-and-test:
name: Build and Test (OS ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest] #, windows-latest] # https://github.com/coactions/setup-xvfb/issues/18
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get Time for BUILD_ID
id: time
uses: nanzm/[email protected]
with:
format: "YYYYMMDD_HHmm"
- name: Get Branch name for BUILD_LABEL
id: branch_name
shell: bash
run: echo "branch=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Cache local Maven repository
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml', '**/*.target') }}
restore-keys: |
${{ runner.os }}-m2
# - name: Cache IntelliJ Aspects
# uses: actions/cache@v4
# with:
# path: ./bundles/com.salesforce.bazel.sdk/aspects
# key: ${{ runner.os }}-aspects-${{ hashFiles('**/aspects/import/import-and-build.sh', '**/aspects/import/WORKSPACE') }}
- name: Cache Bazel repository cache
uses: actions/cache@v4
with:
path: |
~/.cache/bazel
~/.cache/bazelisk
key: ${{ runner.os }}-bazel
- name: Setup Bazelisk
uses: bazelbuild/setup-bazelisk@v3
- name: Print Maven toolchains.xml
shell: bash
run: cat ~/.m2/toolchains.xml
- name: Setup Node version
uses: actions/setup-node@v4
with:
node-version: 16
cache: 'npm'
- name: 📦 Install dependencies
run: npm ci
- name: 🏗 Build project
env:
BUILD_ID: "${{ steps.time.outputs.time }}"
BUILD_TYPE: "S"
BUILD_LABEL: "CI ${{ steps.time.outputs.time }} (${{ steps.branch_name.outputs.branch }})"
run: npm run build
- name: 🧪 Run tests
uses: GabrielBB/xvfb-action@v1
env:
PRINT_JDTLS_LOGS: true
with:
run: npm run test
options: "-screen 0 1600x1200x24"
- name: Upload Test Results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results-${{ matrix.os }}
path: |
test/**/*.xml
test/**/*.json
!test/**/tsconfig.json
!test/**/runConfigurations/*.xml
!test/projects/**/*
- name: Upload screenshots on failure
uses: actions/upload-artifact@v4
if: failure()
with:
name: screenshots-${{ matrix.os }}
path: |
test/screenshots
test/logs
- name: Upload Bazel JDT Language Server extension
uses: actions/upload-artifact@v4
if: success() && matrix.os == 'ubuntu-latest'
with:
name: server
path: server/
if-no-files-found: error
event_file:
name: "Event File"
runs-on: ubuntu-latest
# needed for publishing test results from forks
steps:
- name: Upload
uses: actions/upload-artifact@v4
with:
name: ci-event-file
path: ${{ github.event_path }}