diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index d65042a3..7c286026 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -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 diff --git a/.github/workflows/close-milestone.yml b/.github/workflows/close-milestone.yml new file mode 100644 index 00000000..7d40075d --- /dev/null +++ b/.github/workflows/close-milestone.yml @@ -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 }} \ No newline at end of file diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml new file mode 100644 index 00000000..9a3f4ae4 --- /dev/null +++ b/.github/workflows/draft-release.yml @@ -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 ".*" | 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 }} \ No newline at end of file diff --git a/.github/workflows/java-continuous-integration.yml b/.github/workflows/java-continuous-integration.yml new file mode 100644 index 00000000..c986e37e --- /dev/null +++ b/.github/workflows/java-continuous-integration.yml @@ -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 \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index cdd952b0..00000000 --- a/.travis.yml +++ /dev/null @@ -1,41 +0,0 @@ -language: java -install: true - -os: linux -dist: xenial - -jdk: -- openjdk11 - -addons: - sonarcloud: - organization: "cnescatlab" - token: - secure: "XrTPbT5js+N1quKghtNNwb+F911kkREvm1ucDUb6vBwfGY5n/du9Mas5R632HuV/s8pJcJGi66NwzxhjaZGzvsNT+WhhRzeOTunpPSXzrW1wkN3cYyiURqN7p7c+YhmGVtymgiDmWh9/hamxsWp7PsmnGsAHe8U/omhV/7riU73/AwPahdeAaLdRegUrEvL9814q88d7g6A9gPFssPq9p+NLGP1J7zyNEWfHz59i0GRKFtmBTvqhONvFsostTZ1F+MJRv+Z5YIVCzkiOr99TRYrIQCwBmTXNWp/pZyKTV2xahhdY1UFY7Mtk4IUzrGhTBwaqsazMwF5EI2qdL0oKTabNEQoLtJoIA+vVLS9vONf3/zijcGnMQZvtI0M7HaXuAdIdXXpj/OZdPSrqZy1rVy7RQWoTyK4Wv8jwls3Ocrbpojo/uaSJk4t/iCyToURgQzTPPbeSkX52fFt0ylOnCEQVm8OSjcnx3WeM5jm8moaPXGsJjSvsUjGbyVWwTiqe/oAY1vJDY6TT11+v4mCmLyv21AQg16euMhuSQMKaml/F8Gt/th0Yr1HCXn6Vcw7fwU9IX2sbFrTlip7e4XQ/ohZXuM37IjG/9CrqFU2AI55HneQXERH7qkMTEiZOTYg7vbHZkzzBLTBlPEwtmlnYSObiOq2BFXxzY1wgP3jGTVQ=" - -script: - - mvn clean install sonar:sonar - -cache: - directories: - - '$HOME/.m2/repository' - - '$HOME/.sonar/cache' - -notifications: - email: false - -deploy: - provider: releases - token: "$GITHUB_TOKEN" - file_glob: true - file: - - "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" - skip_cleanup: true - name: "i-Code CNES" - draft: true - on: - branch: master - tags: true - jdk: openjdk11 diff --git a/README.md b/README.md index 1f021a8c..3c06bdeb 100644 --- a/README.md +++ b/README.md @@ -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) @@ -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 @@ -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 diff --git a/icode-ide/fr.cnes.analysis.tools.ui/META-INF/MANIFEST.MF b/icode-ide/fr.cnes.analysis.tools.ui/META-INF/MANIFEST.MF index d47cf5b8..8a01ccce 100755 --- a/icode-ide/fr.cnes.analysis.tools.ui/META-INF/MANIFEST.MF +++ b/icode-ide/fr.cnes.analysis.tools.ui/META-INF/MANIFEST.MF @@ -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", @@ -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, diff --git a/icode-ide/fr.cnes.analysis.tools.ui/pom.xml b/icode-ide/fr.cnes.analysis.tools.ui/pom.xml index 529a8847..26dfa584 100644 --- a/icode-ide/fr.cnes.analysis.tools.ui/pom.xml +++ b/icode-ide/fr.cnes.analysis.tools.ui/pom.xml @@ -6,7 +6,7 @@ fr.cnes.icode icode-ide - 4.1.1-SNAPSHOT + 4.1.2-SNAPSHOT fr.cnes.analysis.tools.ui diff --git a/icode-ide/fr.cnes.icode.feature.ui/feature.xml b/icode-ide/fr.cnes.icode.feature.ui/feature.xml index ff520f0e..1e282a97 100644 --- a/icode-ide/fr.cnes.icode.feature.ui/feature.xml +++ b/icode-ide/fr.cnes.icode.feature.ui/feature.xml @@ -2,7 +2,7 @@ diff --git a/icode-ide/fr.cnes.icode.feature.ui/pom.xml b/icode-ide/fr.cnes.icode.feature.ui/pom.xml index ee4d9d78..5ab77f0e 100644 --- a/icode-ide/fr.cnes.icode.feature.ui/pom.xml +++ b/icode-ide/fr.cnes.icode.feature.ui/pom.xml @@ -6,7 +6,7 @@ fr.cnes.icode icode-ide - 4.1.1-SNAPSHOT + 4.1.2-SNAPSHOT fr.cnes.icode.feature.ui diff --git a/icode-ide/fr.cnes.icode.repository/category.xml b/icode-ide/fr.cnes.icode.repository/category.xml index d0125bf2..65099c2d 100755 --- a/icode-ide/fr.cnes.icode.repository/category.xml +++ b/icode-ide/fr.cnes.icode.repository/category.xml @@ -1,7 +1,7 @@ - + diff --git a/icode-ide/fr.cnes.icode.repository/icode-ide.product b/icode-ide/fr.cnes.icode.repository/icode-ide.product index c1ba9d51..1d9b9c0c 100644 --- a/icode-ide/fr.cnes.icode.repository/icode-ide.product +++ b/icode-ide/fr.cnes.icode.repository/icode-ide.product @@ -1,7 +1,7 @@ - + @@ -73,7 +73,7 @@ - + diff --git a/icode-ide/fr.cnes.icode.repository/pom.xml b/icode-ide/fr.cnes.icode.repository/pom.xml index aef25a64..710e5df5 100644 --- a/icode-ide/fr.cnes.icode.repository/pom.xml +++ b/icode-ide/fr.cnes.icode.repository/pom.xml @@ -6,11 +6,11 @@ fr.cnes.icode icode-ide - 4.1.1-SNAPSHOT + 4.1.2-SNAPSHOT fr.cnes.icode.repository - 4.1.1-SNAPSHOT + 4.1.2-SNAPSHOT eclipse-repository diff --git a/icode-ide/fr.cnes.icode.tp/pom.xml b/icode-ide/fr.cnes.icode.tp/pom.xml index 2a366eef..5f2040b7 100644 --- a/icode-ide/fr.cnes.icode.tp/pom.xml +++ b/icode-ide/fr.cnes.icode.tp/pom.xml @@ -5,7 +5,7 @@ fr.cnes.icode icode-ide - 4.1.1-SNAPSHOT + 4.1.2-SNAPSHOT fr.cnes.icode.tp diff --git a/icode-ide/icode-library-feature/feature.xml b/icode-ide/icode-library-feature/feature.xml index 0bd52ea7..56b755c8 100644 --- a/icode-ide/icode-library-feature/feature.xml +++ b/icode-ide/icode-library-feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/icode-ide/icode-library-feature/pom.xml b/icode-ide/icode-library-feature/pom.xml index 93ace916..1f506a7e 100644 --- a/icode-ide/icode-library-feature/pom.xml +++ b/icode-ide/icode-library-feature/pom.xml @@ -6,7 +6,7 @@ fr.cnes.icode icode-ide - 4.1.1-SNAPSHOT + 4.1.2-SNAPSHOT icode.library.feature diff --git a/icode-ide/icode-library-plugin/META-INF/MANIFEST.MF b/icode-ide/icode-library-plugin/META-INF/MANIFEST.MF index f6383467..164740ff 100644 --- a/icode-ide/icode-library-plugin/META-INF/MANIFEST.MF +++ b/icode-ide/icode-library-plugin/META-INF/MANIFEST.MF @@ -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, diff --git a/icode-ide/icode-library-plugin/pom.xml b/icode-ide/icode-library-plugin/pom.xml index 44a3f315..e6cb45c7 100644 --- a/icode-ide/icode-library-plugin/pom.xml +++ b/icode-ide/icode-library-plugin/pom.xml @@ -6,7 +6,7 @@ fr.cnes.icode icode-ide - 4.1.1-SNAPSHOT + 4.1.2-SNAPSHOT icode.library.plugin diff --git a/icode-ide/pom.xml b/icode-ide/pom.xml index ecbac782..7697c03e 100644 --- a/icode-ide/pom.xml +++ b/icode-ide/pom.xml @@ -11,7 +11,7 @@ icode-ide - 4.1.1-SNAPSHOT + 4.1.2-SNAPSHOT pom i-Code CNES IDE diff --git a/pom.xml b/pom.xml index 898f6d39..afe3d8f6 100644 --- a/pom.xml +++ b/pom.xml @@ -46,8 +46,8 @@ https://github.com/cnescatlab/i-CodeCNES/issues - Travis-CI - https://travis-ci.org/cnescatlab/i-CodeCNES + GitHub Actions + https://github.com/cnescatlab/i-CodeCNES/actions https://github.com/cnescatlab/i-CodeCNES @@ -70,7 +70,7 @@ - 4.1.1 + 4.1.2 UTF-8 UTF-8 1.8