Skip to content

Commit

Permalink
GitHub actions
Browse files Browse the repository at this point in the history
  • Loading branch information
alainbodiguel committed Feb 24, 2022
1 parent dc78fb6 commit 7272c07
Show file tree
Hide file tree
Showing 10 changed files with 58 additions and 40 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Test ARLAS-persistence

on: push

jobs:
integration-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Cache Maven # From https://github.com/actions/cache/blob/main/examples.md
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'adopt'
- name: Warm-up mvn cache
run: |
mvn --version
mvn clean verify
- name: Prepare tests
run: |
sudo sysctl -w vm.max_map_count=262144
sudo mkdir -p /opt/app
sudo cp arlas-persistence-tests/src/test/resources/arlas-test.pem /opt/app/
sudo cp docker/docker-files/pgCreateTable.sql /opt/app/
- name: Run tests [file engine]
env:
# secrets are defined here : https://github.com/organizations/gisaia/settings/secrets/actions
DOCKER_USERNAME: ${{ secrets.DOCKER_HUB_USER }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }}
run: scripts/ci/tests-integration-stage.sh --stage="REST_FILE"
- name: Run tests [hibernate engine]
env:
# secrets are defined here : https://github.com/organizations/gisaia/settings/secrets/actions
DOCKER_USERNAME: ${{ secrets.DOCKER_HUB_USER }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }}
run: scripts/ci/tests-integration-stage.sh --stage="REST_HIBERNATE"
27 changes: 0 additions & 27 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion docker/docker-files/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#####################
# COMPILATION STAGE #
#####################
FROM maven:3.8.2-openjdk-17 as build
FROM maven:3.8.4-openjdk-17 as build
WORKDIR /opt/build

# selectively add the POM file
Expand Down
2 changes: 1 addition & 1 deletion docker/docker-files/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ services:
ports:
- 5432:5432
volumes:
- ${ARLAS_PERSISTENCE_CREATESQL_FILE:-/opt/app/pgCreateTable.sql}:/docker-entrypoint-initdb.d/createTable.sql:ro
- ${ARLAS_PERSISTENCE_CREATESQL_FILE:-/opt/app/pgCreateTable.sql}:/docker-entrypoint-initdb.d/createTable.sql:ro

arlas-persistence-server:
build:
Expand Down
2 changes: 1 addition & 1 deletion mkDocs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ docker run --rm \
-w /opt/maven \
-v $PWD:/opt/maven \
-v $HOME/.m2:/root/.m2 \
maven:3.8.2-openjdk-17 \
maven:3.8.4-openjdk-17 \
mvn swagger2markup:convertSwagger2markup post-integration-test
docker run --rm \
-v $PWD:/opt/maven \
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
<surefire.version>2.22.2</surefire.version>
<jug.version>4.0.1</jug.version>
<dropwizard.version>2.0.28</dropwizard.version>
<postgresql.version>42.3.1</postgresql.version>
<postgresql.version>42.3.3</postgresql.version>
<hibernate.types.version>2.14.0</hibernate.types.version>
<google.cloud.bom.version>24.1.2</google.cloud.bom.version>
<google.cloud.bom.version>24.3.0</google.cloud.bom.version>
<jackson.databind.version>2.13.1</jackson.databind.version>

<!-- TESTS -->
Expand Down
2 changes: 1 addition & 1 deletion release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ else
--mount dst=/mnt/.m2,src="$HOME/.m2/",type=bind \
--mount dst=/opt/maven,src="$PWD",type=bind \
--rm \
maven:3.8.2-openjdk-17 \
maven:3.8.4-openjdk-17 \
clean install
fi

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
set -e
set -o errexit -o pipefail

function clean_docker {
./scripts/docker-clean.sh
Expand All @@ -8,13 +8,15 @@ function clean_docker {
-w /opt/maven \
-v $PWD:/opt/maven \
-v $HOME/.m2:/root/.m2 \
maven:3.8.2-openjdk-17 \
maven:3.8.4-openjdk-17 \
mvn clean
}

function clean_exit {
ARG=$?
echo "===> Exit stage ${STAGE} = ${ARG}"
docker logs db
docker logs arlas-persistence-server
clean_docker
rm -rf /tmp/persist
exit $ARG
Expand Down Expand Up @@ -42,7 +44,7 @@ done
mkdir -p /tmp/persist/
# GO TO PROJECT PATH
SCRIPT_PATH=`cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd`
cd ${SCRIPT_PATH}/..
cd ${SCRIPT_PATH}/../..

# CHECK ALV2 DISCLAIMER
if [ $(find ./*/src -name "*.java" -exec grep -L Licensed {} \; | wc -l) -gt 0 ]; then
Expand Down Expand Up @@ -71,7 +73,7 @@ function test_rest_server() {
-e ARLAS_PERSISTENCE_APP_PATH=${ARLAS_PERSISTENCE_APP_PATH} \
-e ARLAS_PERSISTENCE_ENGINE=${ARLAS_PERSISTENCE_ENGINE} \
--network arlaspersist_default \
maven:3.8.2-openjdk-17 \
maven:3.8.4-openjdk-17 \
mvn -Dit.test=PersistenceIT verify -DskipTests=false -DfailIfNoTests=false
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
set -e
set -o errexit -o pipefail

function clean_exit {
ARG=$?
Expand All @@ -15,7 +15,7 @@ usage(){

# GO TO PROJECT PATH
SCRIPT_PATH=`cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd`
cd ${SCRIPT_PATH}/..
cd ${SCRIPT_PATH}/../..

# TESTS SUITE
./scripts/tests-integration-stage.sh --stage="REST_FILE"
Expand Down
2 changes: 1 addition & 1 deletion scripts/docker-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ docker run --rm \
-w /opt/maven \
-v $PWD:/opt/maven \
-v $HOME/.m2:/root/.m2 \
maven:3.8.2-openjdk-17 \
maven:3.8.4-openjdk-17 \
mvn clean install
echo "arlas-persistence-server:${ARLAS_PERSISTENCE_SERVER_VERSION}"

Expand Down

0 comments on commit 7272c07

Please sign in to comment.