Skip to content

Commit

Permalink
upgrade deps and build against different targets
Browse files Browse the repository at this point in the history
  • Loading branch information
sebthom committed Apr 8, 2024
1 parent ee5b434 commit ec02f09
Show file tree
Hide file tree
Showing 7 changed files with 282 additions and 58 deletions.
83 changes: 42 additions & 41 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,27 @@ defaults:
run:
shell: bash

env:
JAVA_VERSION: 17

jobs:

###########################################################
build:
###########################################################
runs-on: ubuntu-latest
concurrency: ci-${{ github.ref }}
concurrency: ci-${{ github.ref }}-${{ matrix.target-platform }}

env:
JAVA_VERSION: ${{ matrix.java-version }}

strategy:
fail-fast: false
matrix:
include:
- target-platform: oldest
java-version: 17
- target-platform: latest
java-version: 21
- target-platform: unstable
java-version: 21

steps:
- name: Show environment variables
Expand All @@ -78,16 +89,27 @@ jobs:
java-version: ${{ env.JAVA_VERSION }}


- name: "Cache: Restore"
id: cache-restore
if: ${{ !env.ACT }} # https://github.com/nektos/act#skipping-steps
uses: actions/cache/restore@v4
- name: "Cache: Local Maven Repository"
uses: actions/cache@v4
with:
# Excluded sub directory not working https://github.com/actions/cache/issues/494#issuecomment-948783891
path: |
~/.m2/repository
!~/.m2/repository/.cache/tycho/https/raw.githubusercontent.com
~/.m2/repository/*
!~/.m2/repository/.cache/tycho
!~/.m2/repository/.meta/p2-artifacts.properties
!~/.m2/repository/p2
!~/.m2/repository/*SNAPSHOT*
key: ${{ runner.os }}-${{ hashFiles('build.target') }}-${{ hashFiles('**/pom.xml') }}
key: ${{ runner.os }}-repo-mvn-${{ hashFiles('**/pom.xml') }}


- name: "Cache: Local Tycho Repository"
uses: actions/cache@v4
with:
path: |
~/.m2/repository/.cache/tycho
~/.m2/repository/.meta/p2-artifacts.properties
~/.m2/repository/p2
key: ${{ runner.os }}-repo-tycho-${{ hashFiles(format('target-platforms/{0}.target', matrix.target-platform)) }}


- name: "Install: Maven"
Expand All @@ -97,6 +119,7 @@ jobs:


- name: Build with Maven
continue-on-error: ${{ matrix.target-platform == 'unstable' }}
id: maven-build
env:
GITHUB_USER: ${{ github.actor }}
Expand Down Expand Up @@ -126,14 +149,16 @@ jobs:
-s .ci/maven-settings.xml \
-t .ci/maven-toolchains.xml \
-Dtycho.disableP2Mirrors=true \
-Dtycho.target-platform=${{ matrix.target-platform }} \
-Djava.version=${{ matrix.java-version }} \
${{ github.event.inputs.additional_maven_args }} \
clean verify || cat /home/runner/work/haxe4e/haxe4e/haxe4e-tests/target/work/data/.metadata/.log
mv updatesite/target/org.haxe4e.updatesite-*.zip updatesite/target/org.haxe4e.plugin.updatesite.zip
- name: "Delete previous 'latest' release"
if: ${{ github.ref_name == 'main' && !env.ACT }}
if: ${{ matrix.target-platform == 'oldest' && github.ref_name == 'main' && !env.ACT }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_NAME: latest
Expand All @@ -143,7 +168,7 @@ jobs:
- name: "Create 'latest' release"
if: ${{ github.ref_name == 'main' && !env.ACT }}
if: ${{ matrix.target-platform == 'oldest' && github.ref_name == 'main' && !env.ACT }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_NAME: latest
Expand All @@ -158,7 +183,7 @@ jobs:
- name: Deploy p2 update site
if: ${{ github.ref_name == 'main' && !env.ACT }}
if: ${{ matrix.target-platform == 'oldest' && github.ref_name == 'main' && !env.ACT }}
run: |
set -eux
Expand Down Expand Up @@ -204,7 +229,7 @@ jobs:
- name: Generate GitHub Access Token
uses: tibdex/github-app-token@v2 # https://github.com/tibdex/github-app-token
if: ${{ github.ref_name == 'main' && !env.ACT }}
if: ${{ matrix.target-platform == 'oldest' && github.ref_name == 'main' && !env.ACT }}
id: generate_token
# see https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#authenticating-with-github-app-generated-tokens
with:
Expand All @@ -214,7 +239,7 @@ jobs:


- name: Trigger Haxe Studio Build
if: ${{ github.ref_name == 'main' && !env.ACT }}
if: ${{ matrix.target-platform == 'oldest' && github.ref_name == 'main' && !env.ACT }}
run: |
curl --fail \
-H"Authorization: Bearer ${{ steps.generate_token.outputs.token }}" \
Expand All @@ -225,30 +250,6 @@ jobs:
--data '{"event_type": "new-haxe4e-release"}'
##################################################
# Cache Update
# See https://github.com/actions/cache/issues/342
##################################################
- name: "Cache: Delete Previous"
if: ${{ steps.cache-restore.outputs.cache-hit && !env.ACT }}
env:
GH_TOKEN: ${{ github.token }}
run: |
gh extension install actions/gh-actions-cache
# "|| true" is to avoid "Error: Resource not accessible by integration" from failing the job
gh actions-cache delete ${{ steps.cache-restore.outputs.cache-primary-key }} --confirm || true
- name: "Cache: Update"
uses: actions/cache/save@v4
if: ${{ always() && !cancelled() && !env.ACT }} # save cache even fails
with:
path: |
~/.m2/repository
!~/.m2/repository/.cache/tycho/https/raw.githubusercontent.com
!~/.m2/repository/*SNAPSHOT*
key: ${{ steps.cache-restore.outputs.cache-primary-key }}


##################################################
# Setup SSH debug session
##################################################
Expand Down Expand Up @@ -292,7 +293,7 @@ jobs:
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v2 # https://github.com/dependabot/fetch-metadata/
uses: dependabot/fetch-metadata@v2 # https://github.com/dependabot/fetch-metadata/
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

Expand Down
10 changes: 5 additions & 5 deletions feature/feature.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@
<import plugin="org.eclipse.tm4e.languageconfiguration"/>
<import plugin="org.eclipse.tm4e.registry"/>
<import plugin="org.eclipse.wildwebdeveloper.embedder.node"/>
<import plugin="com.fasterxml.jackson.core.jackson-annotations" version="2.16.0" match="compatible"/>
<import plugin="com.fasterxml.jackson.core.jackson-core" version="2.16.0" match="compatible"/>
<import plugin="com.fasterxml.jackson.core.jackson-databind" version="2.16.0" match="compatible"/>
<import plugin="com.fasterxml.jackson.core.jackson-annotations" version="2.17.0" match="compatible"/>
<import plugin="com.fasterxml.jackson.core.jackson-core" version="2.17.0" match="compatible"/>
<import plugin="com.fasterxml.jackson.core.jackson-databind" version="2.17.0" match="compatible"/>
<import plugin="org.apache.commons.commons-io" version="2.11.0" match="compatible"/>
<import plugin="org.apache.commons.lang3" version="3.12.0" match="compatible"/>
<import plugin="net.sf.jstuff.core" version="7.9.0" match="compatible"/>
<import plugin="net.sf.jstuff.xml" version="7.9.0" match="compatible"/>
<import plugin="net.sf.jstuff.core" version="7.10.0" match="compatible"/>
<import plugin="net.sf.jstuff.xml" version="7.10.0" match="compatible"/>
<import plugin="de.sebthom.eclipse.commons" version="1.0.0.20240127-2238" match="compatible"/>
</requires>

Expand Down
10 changes: 5 additions & 5 deletions plugin/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ Require-Bundle: org.eclipse.platform;bundle-version="4.29.0",
org.eclipse.tm4e.languageconfiguration;bundle-version="0.9.0",
org.eclipse.tm4e.registry;bundle-version="0.9.0",
org.eclipse.wildwebdeveloper.embedder.node,
com.fasterxml.jackson.core.jackson-annotations;bundle-version="[2.16.0,3.0.0)",
com.fasterxml.jackson.core.jackson-core;bundle-version="[2.16.0,3.0.0)",
com.fasterxml.jackson.core.jackson-databind;bundle-version="[2.16.0,3.0.0)",
com.fasterxml.jackson.core.jackson-annotations;bundle-version="[2.17.0,3.0.0)",
com.fasterxml.jackson.core.jackson-core;bundle-version="[2.17.0,3.0.0)",
com.fasterxml.jackson.core.jackson-databind;bundle-version="[2.17.0,3.0.0)",
org.apache.commons.commons-io;bundle-version="[2.11.0,3.0.0)",
org.apache.commons.lang3;bundle-version="[3.12.0,4.0.0)",
net.sf.jstuff.core;bundle-version="[7.9.0,8.0.0)",
net.sf.jstuff.xml;bundle-version="[7.9.0,8.0.0)",
net.sf.jstuff.core;bundle-version="[7.10.0,8.0.0)",
net.sf.jstuff.xml;bundle-version="[7.10.0,8.0.0)",
de.sebthom.eclipse.commons;bundle-version="[1.0.0.20240127-2238,2.0.0)"
3 changes: 2 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
<properties>
<java.version>17</java.version>
<tycho.version>4.0.7</tycho.version>
<tycho.target-platform>oldest</tycho.target-platform>

<!-- to prevent:
[ERROR] Failed to execute goal com.hubspot.maven.plugins:dependency-scope-maven-plugin:0.10:check (check@validate) on project org.haxe4e:
Expand Down Expand Up @@ -256,7 +257,7 @@
<executionEnvironment>JavaSE-${java.version}</executionEnvironment>

<target>
<file>../build.target</file>
<file>${maven.multiModuleProjectDirectory}/target-platforms/${tycho.target-platform}.target</file>
</target>
<environments>
<environment>
Expand Down
111 changes: 111 additions & 0 deletions target-platforms/latest.target
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.8"?>
<target includeMode="feature" name="Haxe4E plugin platform config targeting current stable Eclipse release">
<locations>

<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="https://download.eclipse.org/cbi/updates/license" />
<unit id="org.eclipse.license.feature.group" version="0.0.0" />
</location>

<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="https://download.eclipse.org/releases/2024-03/" />
<unit id="org.eclipse.equinox.executable.feature.group" version="0.0.0" />
<unit id="org.eclipse.sdk.ide" version="0.0.0" />
<unit id="org.eclipse.mylyn.wikitext.feature.feature.group" version="0.0.0" />
<unit id="org.eclipse.wildwebdeveloper.embedder.node.feature.feature.group" version="0.0.0" />
</location>

<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="https://download.eclipse.org/eclipse/updates/4.31/" />
<unit id="org.eclipse.jface.text.tests" version="0.0.0" />
<unit id="org.eclipse.test.feature.group" version="0.0.0" />
</location>

<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="https://download.eclipse.org/reddeer/releases/latest" />
<unit id="org.eclipse.reddeer.go" version="0.0.0" />
</location>

<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="https://download.eclipse.org/lsp4e/releases/latest/" />
<unit id="org.eclipse.lsp4e" version="0.0.0" />
<unit id="org.eclipse.lsp4e.source" version="0.0.0" />
<unit id="org.eclipse.lsp4e.debug" version="0.0.0" />
<unit id="org.eclipse.lsp4e.debug.source" version="0.0.0" />
<unit id="org.eclipse.lsp4j" version="0.0.0" />
<unit id="org.eclipse.lsp4j.debug" version="0.0.0" />
<unit id="org.eclipse.lsp4j.jsonrpc" version="0.0.0" />
<unit id="org.eclipse.lsp4j.jsonrpc.debug" version="0.0.0" />
</location>

<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="https://download.eclipse.org/tm4e/releases/latest/" />
<unit id="org.eclipse.tm4e.feature.feature.group" version="0.0.0" />
</location>

<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="https://raw.githubusercontent.com/sebthom/eclipse-commons/updatesite/" />
<unit id="de.sebthom.eclipse.commons.feature.feature.group" version="0.0.0" />
</location>

<location includeDependencyDepth="infinite" includeDependencyScopes="compile" includeSource="true" missingManifest="generate" type="Maven">
<dependencies>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.17.0</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>net.sf.jstuff</groupId>
<artifactId>jstuff-core</artifactId>
<version>7.10.0</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>net.sf.jstuff</groupId>
<artifactId>jstuff-xml</artifactId>
<version>7.10.0</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.25.3</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>5.11.0</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.objenesis</groupId>
<artifactId>objenesis</artifactId>
<version>3.3</version>
<type>jar</type>
</dependency>
</dependencies>
</location>
<location includeDependencyDepth="infinite" includeDependencyScopes="compile" includeSource="true" missingManifest="generate" type="Maven">
<dependencies>
<dependency>
<groupId>com.vegardit.no-npe</groupId>
<artifactId>no-npe-eea-all</artifactId>
<version>1.0.0-SNAPSHOT</version>
<type>jar</type>
</dependency>
</dependencies>
<repositories>
<repository>
<id>no-npe-snapshots</id>
<url>https://raw.githubusercontent.com/vegardit/no-npe/mvn-snapshots-repo/</url>
</repository>
</repositories>
</location>
</locations>

<targetJRE path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17" />
</target>
12 changes: 6 additions & 6 deletions build.target → target-platforms/oldest.target
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.8"?>
<target includeMode="feature" name="Haxe4E Plugin Build Target">
<target includeMode="feature" name="Haxe4E plugin platform config targeting oldest supported Eclipse release">
<locations>

<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
Expand Down Expand Up @@ -36,7 +36,7 @@
</location>

<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="https://download.eclipse.org/tm4e/releases/0.11.0/" />
<repository location="https://download.eclipse.org/tm4e/releases/0.9.0/" />
<unit id="org.eclipse.tm4e.feature.feature.group" version="0.0.0" />
</location>

Expand All @@ -50,25 +50,25 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.16.0</version>
<version>2.17.0</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>net.sf.jstuff</groupId>
<artifactId>jstuff-core</artifactId>
<version>7.9.0</version>
<version>7.10.0</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>net.sf.jstuff</groupId>
<artifactId>jstuff-xml</artifactId>
<version>7.9.0</version>
<version>7.10.0</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.24.2</version>
<version>3.25.3</version>
<type>jar</type>
</dependency>
<dependency>
Expand Down

0 comments on commit ec02f09

Please sign in to comment.