Skip to content

Commit

Permalink
build: support local building with nektos/act
Browse files Browse the repository at this point in the history
  • Loading branch information
sebthom committed Mar 10, 2023
1 parent 0498714 commit d27d50c
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 18 deletions.
2 changes: 2 additions & 0 deletions .actrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# config file for https://github.com/nektos/act
-W .github/workflows/build.yml
26 changes: 17 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: Build

on:
push:
branches: # build all branches
branches: # build all branches
- '**'
tags-ignore: # but don't build tags
tags-ignore: # but don't build tags
- '**'
paths-ignore:
- '**/*.md'
Expand Down Expand Up @@ -39,8 +39,22 @@ jobs:
distribution: 'temurin'
java-version: 17

- name: Configure Fast APT Mirror
uses: vegardit/fast-apt-mirror.sh@v1

- name: Install xvfb
run: sudo apt-get install -o Acquire::Retries=3 --no-install-recommends -y xvfb
run: |
sudo apt-get install --no-install-recommends -y xvfb
sudo apt-get install --no-install-recommends -y dbus-x11
# prevents: "Failed to execute child process β€œdbus-launch” (No such file or directory)"
sudo apt-get install --no-install-recommends -y libswt-gtk-*-java
# prevents:
# java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons:
# no swt-pi4-gtk-4956r13 in java.library.path: /usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib
# no swt-pi4-gtk in java.library.path: /usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib
# no swt-pi4 in java.library.path: /usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib
- name: "Cache: Local Maven Repository"
uses: actions/cache@v3
Expand Down Expand Up @@ -79,9 +93,3 @@ jobs:
--no-transfer-progress \
${{ github.event.inputs.additional_maven_args }} \
clean verify
- name: "Delete intermediate build artifacts"
uses: geekyeggo/delete-artifact@v2 # https://github.com/GeekyEggo/delete-artifact/
with:
name: "*"
failOnError: false
39 changes: 30 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,51 +4,72 @@ Welcome to the Eclipse TM4E contributor land, and thanks in advance for your hel

🏠 Official Eclipse TM4E Git repo is [https://github.com/eclipse/tm4e](https://github.com/eclipse/tm4e) .


## βš–οΈ Legal and Eclipse Foundation terms

The project license is available at [LICENSE](LICENSE).

This Eclipse Foundation open project is governed by the Eclipse Foundation
Development Process and operates under the terms of the Eclipse IP Policy.

Before your contribution can be accepted by the project team,
contributors must have an Eclipse Foundation account and
Before your contribution can be accepted by the project team,
contributors must have an Eclipse Foundation account and
must electronically sign the Eclipse Contributor Agreement (ECA).

* [http://www.eclipse.org/legal/ECA.php](http://www.eclipse.org/legal/ECA.php)

For more information, please see the Eclipse Committer Handbook:
[https://www.eclipse.org/projects/handbook/#resources-commit](https://www.eclipse.org/projects/handbook/#resources-commit).


## πŸ’¬ Get in touch with the community

Eclipse TM4E use mainly 2 channels for strategical and technical discussions

* 🐞 View and report issues through uses GitHub Issues at https://github.com/eclipse/m2e-tm4e/issues.
* πŸ“§ Join the tm4e-dev@eclipse.org mailing-list to get in touch with other contributors about project organization and planning, and browse archive at πŸ“œ [https://accounts.eclipse.org/mailing-list/tm4e-dev](https://accounts.eclipse.org/mailing-list/tm4e-dev)


## πŸ†• Trying latest builds

Latest builds, for testing, can usually be found at `https://download.eclipse.org/tm4e/snapshots/` .


## πŸ§‘β€πŸ’» Developer resources

### ⌨️ Setting up the Development Environment manually


* Use Eclipse IDE with Plugin Development Environment installed.
* Clone this repository <a href="https://mickaelistria.github.io/redirctToEclipseIDECloneCommand/redirect.html"><img src="https://mickaelistria.github.io/redirctToEclipseIDECloneCommand/cloneToEclipseBadge.png" alt="Clone to Eclipse IDE"/></a> for m2e-core.
* _File > Open Projects from Filesystem..._ , select the path to tm4e Git repo and the relevant children projects you want to import
* Download and install the **Eclipse IDE for Eclipse Committers** from https://www.eclipse.org/downloads/packages/ or another Eclipse installation with the [Plug-in Development Environment (PDE)](https://www.eclipse.org/pde/) installed.
* Clone this repository <a href="https://mickaelistria.github.io/redirctToEclipseIDECloneCommand/redirect.html"><img src="https://mickaelistria.github.io/redirctToEclipseIDECloneCommand/cloneToEclipseBadge.png" alt="Clone to Eclipse IDE"/></a>.
* _File > Open Projects from Filesystem..._ , select the path to the tm4e Git repo and the relevant children projects you want to import

### πŸ—οΈ Build

Prerequisite: Latest Maven release or Eclipse m2e.
Prerequisite: Latest Maven release or Eclipse [m2e](https://www.eclipse.org/m2e/).

1. From the command line: run `mvn clean verify`
1. From within Eclipse : right-click on the tm4e root folder > Run As > Maven build

#### Running the CI job locally:

The GitHub actions wokflow is compatible with [nektos/act](https://github.com/nektos/act) a command-line tool that allows you to run GitHub action workflows locally.

1. Install docker
1. Install [nektos/act](https://github.com/nektos/act)
1. From the commandline navigate into the tm4e rpoject root
1. Run the command `act`
1. On subsequent re-runs you can use `act -r` to reuse previous container which avoids reinstallation system packages and reduces build time.

then `mvn clean verify` from CLI or Right-click on the tm4e root folder > Run As > Maven build
In case of build failures the docker container will still be running and you can ssh into it for analysis using `docker exec -u root -it <CONTAINER_ID> /bin/bash`, e.g.:
```bash
container_id=$(docker container ps --filter status=running --filter name=act-Build-build --format {{.ID}})
docker exec -u root -it $container_id /bin/bash
```

### ⬆️ Version bump

tm4e tries to use OSGi Semantic Version (to properly expose its API contracts and breakage) and Reproducible Version Qualifiers (to minimize the avoid producing multiple equivalent artifacts for identical source). This requires the developer to manually bump version from time to time. Somes rules are that:
tm4e tries to use OSGi Semantic Version (to properly expose its API contracts and breakage) and Reproducible Version Qualifiers (to minimize the avoid producing multiple equivalent artifacts for identical source).
This requires the developer to manually bump version from time to time. Somes rules are that:

* Versions are bumped on a __per module grain__ (bump version of individual bundles/features one by one when necessary), __DON'T bump version of parent pom, nor of other modules you don't change__
* __Versions are bumped maximum once per release__ (don't bump versions that were already bumped since last release)
Expand Down

0 comments on commit d27d50c

Please sign in to comment.