-
Notifications
You must be signed in to change notification settings - Fork 4
111 lines (91 loc) · 3.53 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
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
# Furthermore, this workflow also builds a Node.js project with Yarn.
# For more information see: https://docs.github.com/en/actions/guides/building-and-testing-nodejs
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
mavenBuilds:
runs-on: ubuntu-latest
steps:
# Setup
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
- name: Cache local Maven repository
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
# Maven build
- name: build update site
run: MAVEN_OPTS="-Xmx2048M" mvn clean package --file build/pom.xml --update-snapshots
# TODO: find a good way to host this update site directly without zipping it for access for other builds.
# For example this: https://github.com/marketplace/actions/deploy-to-github-pages
# this: https://github.com/peaceiris/actions-gh-pages
# or this: http://www.lorenzobettini.it/2021/03/publishing-an-eclipse-p2-composite-repository-on-github-pages/
- name: Archive OSGiViz Repository Artifact
uses: actions/upload-artifact@v4
with:
name: OSGiViz Repository Artifact
path: build/de.cau.cs.kieler.osgiviz.repository/target/repository/
if-no-files-found: error
- name: Archive OSGimodel Generator CLI
uses: actions/upload-artifact@v4
with:
name: OSGimodel Generator CLI
path: plugins/de.scheidtbachmann.osgimodel.model.generate/target/de.scheidtbachmann.osgimodel.model.generate-*.jar
if-no-files-found: error
- name: Archive OSGiViz Language Server
uses: actions/upload-artifact@v4
with:
name: OSGiViz Language Server
path: plugins/de.cau.cs.kieler.osgiviz.language.server/target/osgiviz-language-server.jar
if-no-files-found: error
nodeBuilds:
needs: mavenBuilds
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./extension/osgiviz
steps:
# Setup
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
# Copy LS from previous job
- name: Retrieve Language Server
uses: actions/download-artifact@v4
with:
name: OSGiViz Language Server
path: extension/osgiviz/server/
# Build
- run: yarn
- run: yarn package
# Artifacts
- name: Archive OSGiViz VS Code Extension vsix
uses: actions/upload-artifact@v4
with:
name: OSGiViz VS Code Extension
path: extension/osgiviz/osgiviz-*.vsix
if-no-files-found: error