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

Updates GitHub Actions #298

Merged
merged 34 commits into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
56fe29d
Updates GitHub Actions
appiepollo14 Nov 4, 2023
dedafa2
Removes update podman
appiepollo14 Nov 5, 2023
4ef68ce
Renames IT classfiles
appiepollo14 Nov 5, 2023
c9e60b9
Dockerlogin step added
appiepollo14 Nov 5, 2023
874fa03
Dockerlogin step added
appiepollo14 Nov 5, 2023
8d2fcad
Dockerlogin step added
appiepollo14 Nov 5, 2023
93b54ee
set environment
appiepollo14 Nov 5, 2023
6695736
Podman login
appiepollo14 Nov 5, 2023
999d7ab
Adds exposed port
appiepollo14 Nov 5, 2023
f7a5b78
Adds exposed port to Dockerfile
appiepollo14 Nov 5, 2023
b6a6a33
Adds exposed port to Dockerfile
appiepollo14 Nov 5, 2023
b2c622e
Update microshed-ci.yml
appiepollo14 Nov 7, 2023
cca2f73
Update microshed-ci.yml
appiepollo14 Nov 7, 2023
baaac8f
Update microshed-ci.yml
appiepollo14 Nov 7, 2023
8fe0722
Update microshed-ci.yml
appiepollo14 Nov 7, 2023
b139a4b
Implemented reviewed changes
appiepollo14 Nov 7, 2023
82f65a4
Try without Podman
appiepollo14 Nov 7, 2023
b80f85c
Try without Podman but with login to dockerhub
appiepollo14 Nov 7, 2023
6041cb4
Location for testcontainer.properties
appiepollo14 Nov 7, 2023
76358c8
Location for testcontainer.properties 2
appiepollo14 Nov 7, 2023
8e2d771
Echo setting to envvar
appiepollo14 Nov 7, 2023
c1f9973
Updates testcontainers
appiepollo14 Nov 7, 2023
912952a
Removes podman completely because testcontainers version allows privi…
appiepollo14 Nov 7, 2023
bafd1c3
Merge branch 'main' into fix/ga-ci
appiepollo14 Nov 7, 2023
90223c7
Removes expose command from Dockerfile
appiepollo14 Nov 7, 2023
f5d8c36
Merge remote-tracking branch 'origin/fix/ga-ci' into fix/ga-ci
appiepollo14 Nov 7, 2023
a612159
Bypasses jaxrs json to check whether the rest will compile
appiepollo14 Nov 7, 2023
88392d9
Bypasses jaxrs json to check whether the rest will compile
appiepollo14 Nov 7, 2023
8a47f3e
Cleans Dockerfiles
appiepollo14 Nov 7, 2023
cb34521
Healthcheck endpoint for jaxrsjson sample app
appiepollo14 Nov 7, 2023
9557e16
Removes withExposedPorts from JaxrsJsonIT
appiepollo14 Nov 7, 2023
4402865
Reverts to healthcheck on application endpoint.
appiepollo14 Nov 7, 2023
e69afea
Merge branch 'main' into fix/ga-ci
appiepollo14 Nov 7, 2023
082572f
Update Dockerfile
appiepollo14 Nov 7, 2023
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
113 changes: 45 additions & 68 deletions .github/workflows/microshed-ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: MicroShed CI

on:
push:
pull_request:
branches:
- main
Expand All @@ -17,33 +18,31 @@ env:
LANG: en_US.UTF-8
jobs:
build:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest ]
java: [ 11 ]
fail-fast: false
max-parallel: 4
name: Build ${{ matrix.java }}, ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Set up Java
uses: joschi/setup-jdk@v2
with:
java-version: 11
openjdk_impl: openj9
- name: Apply repository caches
uses: actions/cache@v2
uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0 # v3.13.0
with:
path: |
~/.gradle/caches/modules-2
!~/.gradle/caches/modules-2/org.microshed*
~/.gradle/wrapper
~/.m2/repository/
!~/.m2/repository/org/microshed/
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-gradle-
java-version: ${{ matrix.java }}
distribution: 'temurin'
cache: gradle
- name: Build with Gradle
run: |
chmod +x gradlew
./gradlew assemble testClasses
integration_tests:
name: Tests - ${{matrix.category}}
runs-on: ubuntu-latest
needs: build
timeout-minutes: 20
strategy:
fail-fast: false
Expand Down Expand Up @@ -71,54 +70,32 @@ jobs:
quarkus-app
wildfly-app
steps:
- uses: actions/checkout@v2
- name: Set up Java
uses: joschi/setup-jdk@v2
with:
java-version: 11
openjdk_impl: openj9
- uses: testspace-com/setup-testspace@v1
with:
domain: ${{ github.repository_owner }}
- name: Apply repository caches
uses: actions/cache@v2
with:
path: |
~/.gradle/caches/modules-2
!~/.gradle/caches/modules-2/org.microshed*
~/.gradle/wrapper
~/.m2/repository/
!~/.m2/repository/org/microshed/
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Run integration tests
shell: bash
env:
TEST_PROJECTS: ${{matrix.projects}}
CATEGORY: ${{matrix.category}}
run: |
chmod +x gradlew
echo "org.gradle.daemon=false" >> gradle.properties

echo "Will be running projects $TEST_PROJECTS"
for TEST_PROJECT in $TEST_PROJECTS
do
if [[ ! -d "sample-apps/$TEST_PROJECT" ]]; then
echo "::error::Test project $TEST_PROJECT does not exist.";
exit 1;
fi
done

for TEST_PROJECT in $TEST_PROJECTS
do
echo "### BEGIN running test project $TEST_PROJECT"
./gradlew :microshed-testing-$TEST_PROJECT:test
echo "### END running test project $TEST_PROJECT";
done

echo "Done running all tests."
- name: Upload test results
if: always()
run: |
testspace [${{matrix.category}}]sample-apps/*/build/test-results/**/*.xml
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Set up Java
uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0 # v3.13.0
with:
java-version: 11
distribution: 'temurin'
cache: gradle
- name: Run integration tests
shell: bash
env:
TEST_PROJECTS: ${{matrix.projects}}
CATEGORY: ${{matrix.category}}
run: |
chmod +x gradlew
echo "org.gradle.daemon=false" >> gradle.properties

echo "Will be running projects $TEST_PROJECTS"
for TEST_PROJECT in $TEST_PROJECTS
do
if [[ ! -d "sample-apps/$TEST_PROJECT" ]]; then
echo "::error::Test project $TEST_PROJECT does not exist.";
exit 1;
fi
echo "### BEGIN running test project $TEST_PROJECT"
./gradlew :microshed-testing-$TEST_PROJECT:test
echo "### END running test project $TEST_PROJECT";
done

echo "Done running all tests."
1 change: 0 additions & 1 deletion sample-apps/everything-app/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# OpenLiberty
FROM openliberty/open-liberty:full-java8-openj9-ubi
COPY src/main/liberty/config /config/
ADD build/libs/myservice.war /config/dropins/
Expand Down
16 changes: 1 addition & 15 deletions sample-apps/jaxrs-basicauth/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
# OpenLiberty
FROM openliberty/open-liberty:full-java8-openj9-ubi
COPY src/main/liberty/config /config/
ADD build/libs/myservice.war /config/apps/

# Wildfly
#FROM jboss/wildfly
#ADD build/libs/myservice.war /opt/jboss/wildfly/standalone/deployments/

# Payara
#FROM payara/micro:5.193
#CMD ["--deploymentDir", "/opt/payara/deployments", "--noCluster"]
#ADD build/libs/myservice.war /opt/payara/deployments

# TomEE
#FROM tomee:8-jre-8.0.0-M2-microprofile
#COPY build/libs/myservice.war /usr/local/tomee/webapps/
ADD build/libs/myservice.war /config/apps/
16 changes: 1 addition & 15 deletions sample-apps/jaxrs-json/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
# OpenLiberty
FROM openliberty/open-liberty:full-java8-openj9-ubi
COPY src/main/liberty/config /config/
ADD build/libs/myservice.war /config/dropins/

# Wildfly
#FROM jboss/wildfly
#ADD build/libs/myservice.war /opt/jboss/wildfly/standalone/deployments/

# Payara
#FROM payara/micro:5.193
#CMD ["--deploymentDir", "/opt/payara/deployments", "--noCluster"]
#ADD build/libs/myservice.war /opt/payara/deployments

# TomEE
#FROM tomee:8-jre-8.0.0-M2-microprofile
#COPY build/libs/myservice.war /usr/local/tomee/webapps/
ADD build/libs/myservice.war /config/dropins/
Original file line number Diff line number Diff line change
Expand Up @@ -18,34 +18,30 @@
*/
package org.example.app;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;

import java.util.Collection;

import javax.ws.rs.BadRequestException;
import javax.ws.rs.NotFoundException;
import javax.ws.rs.ProcessingException;

import org.junit.jupiter.api.Test;
import org.microshed.testing.jaxrs.RESTClient;
import org.microshed.testing.jupiter.MicroShedTest;
import org.microshed.testing.testcontainers.ApplicationContainer;
import org.testcontainers.junit.jupiter.Container;

import javax.ws.rs.BadRequestException;
import javax.ws.rs.NotFoundException;
import javax.ws.rs.ProcessingException;
import java.util.Collection;

import static org.junit.jupiter.api.Assertions.*;

@MicroShedTest
public class JaxrsJsonIT {

@Container
public static ApplicationContainer app = new ApplicationContainer()
.withAppContextRoot("/myservice")
.withReadinessPath("/myservice/app/people");
.withAppContextRoot("/myservice")
.withReadinessPath("/myservice/app/people");

@RESTClient
public static PersonService personSvc;

@Test
public void testCreatePerson() {
Long createId = personSvc.createPerson("Hank", 42);
Expand All @@ -56,14 +52,14 @@ public void testCreatePerson() {
public void testMinSizeName() {
Long minSizeNameId = personSvc.createPerson("Ha", 42);
assertEquals(new Person("Ha", 42, minSizeNameId),
personSvc.getPerson(minSizeNameId));
personSvc.getPerson(minSizeNameId));
}

@Test
public void testMinAge() {
Long minAgeId = personSvc.createPerson("Newborn", 0);
assertEquals(new Person("Newborn", 0, minAgeId),
personSvc.getPerson(minAgeId));
personSvc.getPerson(minAgeId));
}

@Test
Expand Down Expand Up @@ -127,7 +123,7 @@ public void testCreateBadPersonNegativeAge() {
public void testCreateBadPersonNameTooLong() {
assertThrows(BadRequestException.class, () -> personSvc.createPerson("NameTooLongPersonNameTooLongPersonNameTooLongPerson", 5));
}

@Test
public void testNonJaxrsMethod() {
assertThrows(ProcessingException.class, () -> personSvc.nonJaxrsMethod());
Expand Down
16 changes: 1 addition & 15 deletions sample-apps/jaxrs-mpjwt/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
# OpenLiberty
FROM openliberty/open-liberty:full-java8-openj9-ubi
COPY src/main/liberty/config /config/
ADD build/libs/myservice.war /config/dropins/

# Wildfly
#FROM jboss/wildfly
#ADD build/libs/myservice.war /opt/jboss/wildfly/standalone/deployments/

# Payara
#FROM payara/micro:5.193
#CMD ["--deploymentDir", "/opt/payara/deployments", "--noCluster"]
#ADD build/libs/myservice.war /opt/payara/deployments

# TomEE
#FROM tomee:8-jre-8.0.0-M2-microprofile
#COPY build/libs/myservice.war /usr/local/tomee/webapps/
ADD build/libs/myservice.war /config/dropins/
1 change: 0 additions & 1 deletion sample-apps/kafka-app/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# OpenLiberty
FROM openliberty/open-liberty:full-java8-openj9-ubi
COPY src/main/liberty/config /config/
ADD build/libs/myservice.war /config/apps/
Expand Down
13 changes: 0 additions & 13 deletions sample-apps/maven-app/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
FROM openliberty/open-liberty:full-java8-openj9-ubi
COPY src/main/liberty/config /config/
ADD target/myservice.war /config/dropins/

# Wildfly
#FROM jboss/wildfly
#ADD target/myservice.war /opt/jboss/wildfly/standalone/deployments/

# Payara
#FROM payara/micro:5.193
#CMD ["--deploymentDir", "/opt/payara/deployments", "--noCluster"]
#ADD target/myservice.war /opt/payara/deployments

# TomEE
#FROM tomee:8-jre-8.0.0-M2-microprofile
#COPY target/myservice.war /usr/local/tomee/webapps/
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,16 @@
import org.testcontainers.junit.jupiter.Container;

@MicroShedTest
public class JaxrsJsonIT {
public class PayaraIT {

@Container
public static ApplicationContainer app = new ApplicationContainer()
.withAppContextRoot("/myservice")
.withReadinessPath("/myservice/app/people");

@RESTClient
public static PersonService personSvc;

@Test
public void testCreatePerson() {
Long createId = personSvc.createPerson("Hank", 42);
Expand Down Expand Up @@ -127,7 +127,7 @@ public void testCreateBadPersonNegativeAge() {
public void testCreateBadPersonNameTooLong() {
assertThrows(BadRequestException.class, () -> personSvc.createPerson("NameTooLongPersonNameTooLongPersonNameTooLongPerson", 5));
}

@Test
public void testNonJaxrsMethod() {
assertThrows(ProcessingException.class, () -> personSvc.nonJaxrsMethod());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
import org.testcontainers.junit.jupiter.Container;

@MicroShedTest
public class JaxrsJsonIT {
public class WildFlyIT {

@Container
public static ApplicationContainer app = new ApplicationContainer()
Expand Down