Skip to content

Commit

Permalink
chore(ci): adjust ci
Browse files Browse the repository at this point in the history
- move `jacoco-maven-plugin` to `maven` profile
  speedup daily dev
- add more jdks in `github` workflow
- enable more maven operations
  as consistent as possible with the actual release operations
- remove `windows` ci on `appveyor`
  use `github` workflow instead
- add github workflow ci badge
  • Loading branch information
oldratlee committed May 18, 2023
1 parent de8735d commit 08dbb67
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 93 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Java CI
name: CI

on:
push:
Expand All @@ -16,10 +16,10 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-18.04 ]
java: [ 8, 11, 17 ]
os: [ ubuntu-20.04, windows-2022 ]
java: [ 8, 11, 17, 18 ]
fail-fast: false
max-parallel: 16
max-parallel: 32
name: Test JDK ${{ matrix.java }}, ${{ matrix.os }}

steps:
Expand All @@ -31,9 +31,9 @@ jobs:
java-version: ${{ matrix.java }}
cache: 'maven'
- name: Test with Maven
run: ./mvnw clean test
run: ./mvnw -V --no-transfer-progress -Pgen-code-cov '-P!gen-sign' -DperformRelease clean package
- name: Upload coverage to Codecov
# https://github.com/marketplace/actions/codecov
# https://github.com/marketplace/actions/codecov
uses: codecov/codecov-action@v3
with:
name: codecov-umbrella
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# <div align="center"><a href="#"><img src="docs/logo-green.png" alt="auto-pipeline 🚀"></a></div>

<p align="center">
<a href="https://ci.appveyor.com/project/oldratlee/auto-pipeline"><img src="https://img.shields.io/appveyor/ci/oldratlee/auto-pipeline/main?logo=appveyor&logoColor=white" alt="Build Status"></a>
<a href="https://codecov.io/gh/foldright/auto-pipeline"><img src="https://codecov.io/gh/foldright/auto-pipeline/branch/main/graph/badge.svg?token=3MOZSV0IK6"/></a>
<a href="https://github.com/foldright/auto-pipeline/actions/workflows/ci.yml"><img src="https://img.shields.io/github/workflow/status/foldright/auto-pipeline/CI/main?logo=github&logoColor=white" alt="Github Workflow Build Status"></a>
<a href="https://ci.appveyor.com/project/oldratlee/auto-pipeline"><img src="https://img.shields.io/appveyor/ci/oldratlee/auto-pipeline/main?logo=appveyor&logoColor=white" alt="Appveyor Build Status"></a>
<a href="https://codecov.io/gh/foldright/auto-pipeline"><img src="https://img.shields.io/codecov/c/github/foldright/auto-pipeline/main?logo=codecov&logoColor=white" alt="Coverage Status"></a>
<a href="https://openjdk.java.net/"><img src="https://img.shields.io/badge/Java-8+-green?logo=java&logoColor=white" alt="Java support"></a>
<a href="https://www.apache.org/licenses/LICENSE-2.0.html"><img src="https://img.shields.io/github/license/foldright/auto-pipeline?color=4D7A97&logo=apache" alt="License"></a>
<a href="https://search.maven.org/search?q=g:com.foldright.auto-pipeline"><img src="https://img.shields.io/maven-central/v/com.foldright.auto-pipeline/auto-pipeline-annotations?logo=apache-maven" alt="Maven Central"></a>
Expand Down
86 changes: 23 additions & 63 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@
# https://github.com/cdcseacave/openMVS/blob/master/.appveyor.yml

version: '{build}'
image:
- Ubuntu2004
- Visual Studio 2017
image: Ubuntu2004
build: false
clone_depth: 50
branches:
Expand All @@ -25,63 +23,25 @@ environment:
MAVEN_OPTS: "-Xmx768m -Dhttps.protocols=TLSv1,TLSv1.1,TLSv1.2"
JAVA_OPTS: "-Xmx768m"

for:
-
#------------------
# Ubuntu
#------------------
matrix:
only:
- image: Ubuntu2004

install:
- git submodule update --init
test_script:
- scripts/integration_test

after_test:
# remove self maven install
- rm -rf $HOME/.m2/repository/com/foldright/auto-pipeline*
# remove maven install file
- rm -rf $HOME/.m2/wrapper/dists/*/*/*.zip
# remove gradle install file
- rm -rf $HOME/.gradle/wrapper/dists/*/*/*.zip
# # remove sdkman install file
- rm -rf $HOME/.sdkman/archives/*

cache:
# if cache size is exceed appveyor limit:
# Compressed cache item cannot exceed 1,048,576,000 bytes
# skip below maven cache:
- $HOME/.m2/
- $HOME/.gradle/
- $HOME/.sdkman/
-
#------------------
# Windows
#------------------
matrix:
only:
- image: Visual Studio 2017
install:
- ps: "ls 'C:/Program Files/Java/jdk*'"
- ps: "ls 'C:/Program Files (x86)/Java/jdk*'"
- echo JAVA_HOME=%JAVA_HOME%, HOMEPATH=%HOMEPATH%, PATH=%PATH%

test_script:
# test under java 11
- set JAVA_HOME=C:\Program Files\Java\jdk11
- ./mvnw.cmd -DperformRelease -P!gen-sign -V --no-transfer-progress clean install
# test under java 8
- set JAVA_HOME=C:\Program Files\Java\jdk1.8.0
- ./mvnw.cmd -DperformRelease -P!gen-sign -V --no-transfer-progress surefire:test

after_test:
# remove self maven install
- ps: Remove-Item -r -fo $home\.m2\repository\com\foldright\auto-pipeline*
# remove maven install file
- ps: Remove-Item -Path $HOME\.m2\wrapper\dists\*\*\*.zip

cache:
# https://www.appveyor.com/docs/build-cache/
- '%HOMEDRIVE%%HOMEPATH%\.m2\'
install:
- git submodule update --init
test_script:
- scripts/integration_test

after_test:
# remove self maven install
- rm -rf $HOME/.m2/repository/com/foldright/auto-pipeline*
# remove maven install file
- rm -rf $HOME/.m2/wrapper/dists/*/*/*.zip
# remove gradle install file
- rm -rf $HOME/.gradle/wrapper/dists/*/*/*.zip
# # remove sdkman install file
- rm -rf $HOME/.sdkman/archives/*

cache:
# if cache size is exceed appveyor limit:
# Compressed cache item cannot exceed 1,048,576,000 bytes
# skip below maven cache:
- $HOME/.m2/
- $HOME/.gradle/
- $HOME/.sdkman/
51 changes: 31 additions & 20 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -354,25 +354,6 @@
<generateBackupPoms>false</generateBackupPoms>
</configuration>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<pluginManagement>
<plugins>
Expand Down Expand Up @@ -489,7 +470,7 @@
</build>
</profile>
<profile>
<id>gen-doc</id>
<id>gen-javadoc</id>
<activation>
<property>
<name>performRelease</name>
Expand All @@ -514,6 +495,7 @@
<charset>UTF-8</charset>
<encoding>UTF-8</encoding>
<docencoding>UTF-8</docencoding>
<doclint>all,-missing</doclint>
<!-- https://maven.apache.org/plugins/maven-javadoc-plugin/examples/exclude-package-names.html -->
<excludePackageNames>*.internal.*</excludePackageNames>
<overview>src/api/overview.html</overview>
Expand Down Expand Up @@ -603,6 +585,35 @@
</plugins>
</build>
</profile>
<profile>
<id>gen-code-cov</id>
<build>
<plugins>
<plugin>
<!-- for codecov.io -->
<!-- config example: https://github.com/codecov/example-java -->
<!-- plugin docs: https://eclemma.org/jacoco/trunk/doc/ -->
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>enforcer+when-release</id>
<activation>
Expand Down
2 changes: 1 addition & 1 deletion scripts/bash-buddy
2 changes: 1 addition & 1 deletion scripts/integration_test
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ prepare_jdks::switch_to_jdk "$default_build_jdk_version"

cu::head_line_echo "build and test with Java: $JAVA_HOME"

jvb::mvn_cmd clean install
jvb::mvn_cmd -Pgen-code-cov '-P!gen-sign' -DperformRelease clean install
(
cd auto-pipeline-examples
cu::log_then_run ./gradlew clean test
Expand Down

0 comments on commit 08dbb67

Please sign in to comment.