Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix add action ci #227

Merged
merged 5 commits into from
Aug 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ What types of changes does your code introduce to i-Code?
- [ ] I have read the [CONTRIBUTING](https://github.com/cnescatlab/i-CodeCNES/blob/master/CONTRIBUTING.md) doc
- [ ] I agree with the [CODE OF CONDUCT](https://github.com/cnescatlab/i-CodeCNES/blob/master/CONTRIBUTING.md)
- [ ] Lint and unit tests pass locally with my changes
- [ ] SonarCloud and Travis CI tests pass with my changes
- [ ] SonarCloud and GitHub Actions tests pass with my changes
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] I have added necessary documentation (if appropriate)
- [ ] Any dependent changes have been merged and published in downstream modules
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/close-milestone.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Description
# ===========
# This workflow is triggered each time the Java CI workflow succeeds
# on master.
# It looks for a milestone that is completed and close it.
---
name: Close Milestone

on:
workflow_run:
workflows: ["Java CI"]
branches: [master]
types:
- completed

jobs:
close:
name: Close completed milestone
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Close a milestone if completed
run: |
milestones=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
https://api.github.com/repos/${{ github.repository }}/milestones \
| jq -r '. | map(select(.open_issues == 0 and .closed_issues > 0 and .state == "open"))')
if [ "$milestones" != "[]" ]
then
milestone_number=$(echo "$milestones" | jq -r '.[0].number')
curl -s \
-X PATCH \
-H "Authorization: token ${GITHUB_TOKEN}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ github.repository }}/milestones/${milestone_number} \
-d '{"state":"closed"}'
fi
env:
# Personal access tokens should be generated from https://github.com/settings/tokens with repository scope
GITHUB_TOKEN: ${{ secrets.REPO_SCOPED_TOKEN }}
60 changes: 60 additions & 0 deletions .github/workflows/draft-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Description
# ===========
# This workflow is triggered each time a milestone is closed
# It builds the jar, generates release notes, pushes a new tag
# and makes a draft release with these elements.
---
name: Draft Release

on:
milestone:
types: [closed]

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v2
- name: Setup java
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '11'
- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build with Maven
run: mvn -B clean package
- name: Create Release Notes
uses: docker://decathlon/release-notes-generator-action:2.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OUTPUT_FOLDER: temp_release_notes
- name: Set tag and project values
run: |
echo "tag=$(cat pom.xml | grep "<version>.*</version>" | head -1 |awk -F'[><]' '{print $3}')" >> $GITHUB_ENV
echo "project=$(echo ${{ github.repository }} | awk -F '/' '{print $2}')" >> $GITHUB_ENV
- name: Create a tag for the release
run: |
git config --global user.name "GitHub Actions"
git config --global user.email catlab@cnes.fr
git tag -a ${{ env.tag }} -m "Release ${{ env.tag }}"
git push origin ${{ env.tag }}
- name: Create GitHub Release
uses: ncipollo/release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
artifacts:
- "icode-app/target/icode-*.zip"
- "icode-ide/fr.cnes.icode.repository/target/products/icode-ide.product-*.zip"
- "icode-ide/fr.cnes.icode.repository/target/fr.cnes.icode.repository-*.zip"
tag: ${{ env.tag }}
name: ${{ env.project }} ${{ env.tag }}
bodyFile: "temp_release_notes/release_file.md"
draft: true
token: ${{ secrets.GITHUB_TOKEN }}
83 changes: 83 additions & 0 deletions .github/workflows/java-continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Description
# ===========
# This workflow is triggered each time
# commits are pushed to GitHub or a pull request is opened.
# It launches three jobs in parallel : a build with java 8,
# a build with java 11 and a SonarCloud analysis.
---
name: Java CI

on: [push, pull_request]

jobs:

build:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ '8', '11' ]
name: Java ${{ matrix.Java }} CI
steps:
- name: Check out repository code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup java
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: ${{ matrix.java }}
- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Cache node_modules
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-
- name: Build with Maven
run: mvn -B clean package
code-analysis:
runs-on: ubuntu-latest
name: SonarCloud Code Analysis
# It's not possible to launch an analysis on external pull requests
if: ${{ github.repository_owner == 'cnescatlab' }}
steps:
- name: Check out repository code
uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Setup java
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '11'
- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Cache node_modules
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-
- name: Cache SonarCloud packages
uses: actions/cache@v2
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Build and analyze
env:
# Needed to get some information about the pull request, if any
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# SonarCloud access token should be generated from https://sonarcloud.io/account/security/
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent package sonar:sonar -Dsonar.organization=lequal -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=$SONAR_TOKEN
41 changes: 0 additions & 41 deletions .travis.yml

This file was deleted.

9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
![i-Code logo](https://github.com/cnescatlab/i-CodeCNES/blob/master/img/logo-i-code-cnes.png)

[![Build Status](https://travis-ci.org/cnescatlab/i-CodeCNES.svg?branch=master)](https://travis-ci.org/cnescatlab/i-CodeCNES)
[![Java CI](https://github.com/cnescatlab/sonar-cnes-report/actions/workflows/java-continuous-integration.yml/badge.svg)](https://github.com/cnescatlab/i-CodeCNES/actions/workflows/java-continuous-integration.yml)
[![SonarQube Quality Gate](https://sonarcloud.io/api/project_badges/measure?project=lequal_i-CodeCNES&metric=alert_status)](https://sonarcloud.io/dashboard?id=lequal_i-CodeCNES)
[![SonarQube Bugs](https://sonarcloud.io/api/project_badges/measure?project=lequal_i-CodeCNES&metric=bugs)](https://sonarcloud.io/project/issues?id=lequal_i-CodeCNES&resolved=false&types=BUG)
[![SonarQube Coverage](https://sonarcloud.io/api/project_badges/measure?project=lequal_i-CodeCNES&metric=coverage)](https://sonarcloud.io/component_measures?id=lequal_i-CodeCNES&metric=Coverage)
Expand Down Expand Up @@ -81,9 +81,14 @@ If you need to add some new feature, the easiest way is to implment your own plu

## Changelog

#### Release 4.1.2
###### Fixed bugs
- [x] **BUG #226** > Continuous integration on Travis doesn't work anymore

#### Release 4.1.1
###### Fixed bugs
- [x] **BUG #221** > Too many open files
- [x] **BUG #224** > Remove LEQUAL from this repository

#### Release 4.1.0

Expand Down Expand Up @@ -124,7 +129,7 @@ If you need to add some new feature, the easiest way is to implment your own plu
- A `Developer Guide` is now available here: https://github.com/cnescatlab/icode-custom-plugin-example/wiki/Developer-guide
- Users are able to add custom plugins by putting their `jar` files into `icode/plugins/` directory
- Bug about recursive analysis is fixed and users can now simply analyze a directory, e.g.: `icode .`
- The continuous integration was enhanced with Travis(https://travis-ci.org/cnescatlab/i-CodeCNES) and SonarCloud(https://sonarcloud.io/dashboard?id=lequal_i-CodeCNES)
- The continuous integration was enhanced with GitHub Actions (https://github.com/cnescatlab/i-CodeCNES/actions) and SonarCloud(https://sonarcloud.io/dashboard?id=lequal_i-CodeCNES)
- The contributing page and issue templates were updated
- Eclipse RCP was removed from core features of i-Code
- Some other minor enhancements and fixes
Expand Down
4 changes: 2 additions & 2 deletions icode-ide/fr.cnes.analysis.tools.ui/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: i-Code CNES UI
Bundle-SymbolicName: fr.cnes.analysis.tools.ui;singleton:=true
Bundle-Version: 4.1.1.qualifier
Bundle-Version: 4.1.2.qualifier
Bundle-Activator: fr.cnes.analysis.tools.ui.Activator
Require-Bundle: org.eclipse.core.runtime;bundle-version="3.11.0",
org.eclipse.ui;bundle-version="3.107.0",
Expand All @@ -16,7 +16,7 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="3.11.0",
org.eclipse.ui.editors;bundle-version="3.9.0",
org.eclipse.e4.core.di;bundle-version="1.6.0",
org.eclipse.jface,
icode.library.plugin;bundle-version="4.1.1"
icode.library.plugin;bundle-version="4.1.2"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Export-Package: fr.cnes.analysis.tools.ui.exception,
Expand Down
2 changes: 1 addition & 1 deletion icode-ide/fr.cnes.analysis.tools.ui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>fr.cnes.icode</groupId>
<artifactId>icode-ide</artifactId>
<version>4.1.1-SNAPSHOT</version>
<version>4.1.2-SNAPSHOT</version>
</parent>

<artifactId>fr.cnes.analysis.tools.ui</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion icode-ide/fr.cnes.icode.feature.ui/feature.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<feature
id="fr.cnes.icode.feature.ui"
label="i-Code CNES UI"
version="4.1.1.qualifier"
version="4.1.2.qualifier"
provider-name="CNES">

<description url="http://www.example.com/description">
Expand Down
2 changes: 1 addition & 1 deletion icode-ide/fr.cnes.icode.feature.ui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>fr.cnes.icode</groupId>
<artifactId>icode-ide</artifactId>
<version>4.1.1-SNAPSHOT</version>
<version>4.1.2-SNAPSHOT</version>
</parent>

<artifactId>fr.cnes.icode.feature.ui</artifactId>
Expand Down
4 changes: 2 additions & 2 deletions icode-ide/fr.cnes.icode.repository/category.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<site>
<feature url="features/fr.cnes.icode.feature.ui_4.1.1.qualifier.jar" id="fr.cnes.icode.feature.ui"
version="4.1.1.qualifier">
<feature url="features/fr.cnes.icode.feature.ui_4.1.2.qualifier.jar" id="fr.cnes.icode.feature.ui"
version="4.1.2.qualifier">
<category name="fr.cnes.icode"/>
</feature>
<category-def name="fr.cnes.icode" label="i-Code CNES"/>
Expand Down
4 changes: 2 additions & 2 deletions icode-ide/fr.cnes.icode.repository/icode-ide.product
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<?pde version="3.5"?>

<product name="i-Code CNES IDE" uid="icode-ide.product" id="org.eclipse.platform.ide" application="org.eclipse.ui.ide.workbench" version="4.1.1" useFeatures="true" includeLaunchers="true">
<product name="i-Code CNES IDE" uid="icode-ide.product" id="org.eclipse.platform.ide" application="org.eclipse.ui.ide.workbench" version="4.1.2" useFeatures="true" includeLaunchers="true">


<configIni use="default">
Expand Down Expand Up @@ -73,7 +73,7 @@
<feature id="org.eclipse.cdt.gnu.debug"/>
<feature id="org.eclipse.cdt.gdb"/>
<feature id="org.eclipse.e4.rcp"/>
<feature id="fr.cnes.icode.feature.ui" version="4.1.1.qualifier"/>
<feature id="fr.cnes.icode.feature.ui" version="4.1.2.qualifier"/>
<feature id="icode.library.feature" installMode="root"/>
</features>

Expand Down
4 changes: 2 additions & 2 deletions icode-ide/fr.cnes.icode.repository/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
<parent>
<groupId>fr.cnes.icode</groupId>
<artifactId>icode-ide</artifactId>
<version>4.1.1-SNAPSHOT</version>
<version>4.1.2-SNAPSHOT</version>
</parent>

<artifactId>fr.cnes.icode.repository</artifactId>
<version>4.1.1-SNAPSHOT</version>
<version>4.1.2-SNAPSHOT</version>
<packaging>eclipse-repository</packaging>


Expand Down
2 changes: 1 addition & 1 deletion icode-ide/fr.cnes.icode.tp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>fr.cnes.icode</groupId>
<artifactId>icode-ide</artifactId>
<version>4.1.1-SNAPSHOT</version>
<version>4.1.2-SNAPSHOT</version>
</parent>

<artifactId>fr.cnes.icode.tp</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion icode-ide/icode-library-feature/feature.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<feature
id="icode.library.feature"
label="i-Code Library Feature"
version="4.1.1.qualifier"
version="4.1.2.qualifier"
provider-name="CNES">

<description url="http://www.example.com/description">
Expand Down
2 changes: 1 addition & 1 deletion icode-ide/icode-library-feature/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>fr.cnes.icode</groupId>
<artifactId>icode-ide</artifactId>
<version>4.1.1-SNAPSHOT</version>
<version>4.1.2-SNAPSHOT</version>
</parent>

<artifactId>icode.library.feature</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion icode-ide/icode-library-plugin/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: i-Code Library Plugin
Bundle-SymbolicName: icode.library.plugin;singleton:=true
Bundle-Version: 4.1.1.qualifier
Bundle-Version: 4.1.2.qualifier
Bundle-ClassPath: target/lib/icode-library.jar
Bundle-Vendor: CNES
Export-Package: com.google.common.annotations,
Expand Down
Loading