Skip to content

Revert "init"

Revert "init" #4184

# @author Ivan Senic
name: Continuous Integration
# runs on
# * pushes and pull requests on the "main" (pull request only for specific paths)
# * manual trigger
on:
push:
branches: [ "main"]
pull_request:
branches: [ "main", "feature/*" ]
workflow_dispatch:
# cancel same workflows in progress for pull request branches
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
# global env vars, available in all jobs and steps
env:
MAVEN_OPTS: '-Xmx4g'
DS_ARTIFACTORY_USERNAME: ${{ secrets.DS_ARTIFACTORY_USERNAME }}
DS_ARTIFACTORY_PASSWORD: ${{ secrets.DS_ARTIFACTORY_PASSWORD }}
# Jobs structure:
#
# 1. Runs unit tests
# 2. Then 2 jobs in parallel
# a) Integration tests with DSE 6.9
# b) Integration tests with HCD
jobs:
# runs unit tests
build:
name: Unit tests
runs-on: ubuntu-latest
# max run time 12 minutes
timeout-minutes: 12
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
cache: maven
- name: Setup Maven
run: |
mkdir -p ~/.m2
cat <<EOF > ~/.m2/settings.xml
<settings>
<servers>
<server>
<id>stargate-central</id>
<username>${DS_ARTIFACTORY_USERNAME}</username>
<password>${DS_ARTIFACTORY_PASSWORD}</password>
</server>
<server>
<id>stargate-snapshots</id>
<username>${DS_ARTIFACTORY_USERNAME}</username>
<password>${DS_ARTIFACTORY_PASSWORD}</password>
</server>
<server>
<id>artifactory</id>
<username>${DS_ARTIFACTORY_USERNAME}</username>
<password>${DS_ARTIFACTORY_PASSWORD}</password>
</server>
<server>
<id>artifactory-snapshots</id>
<username>${DS_ARTIFACTORY_USERNAME}</username>
<password>${DS_ARTIFACTORY_PASSWORD}</password>
</server>
<server>
<id>artifactory-releases</id>
<username>${DS_ARTIFACTORY_USERNAME}</username>
<password>${DS_ARTIFACTORY_PASSWORD}</password>
</server>
</servers>
</settings>
EOF
- name: Build & Test
run: |
./mvnw -B -ntp clean test
# runs int tests
int-tests:
name: Integration tests
runs-on: ubuntu-latest
# max run time 40 minutes
timeout-minutes: 40
strategy:
# let all tests run, can find multiple failures in different setup
fail-fast: false
# matrix props:
matrix:
type: [ docker, dse69-it, hcd-it ]
include:
- type: dse69-it
profile: '-Pdse69-it'
- type: hcd-it
profile: '-Phcd-it'
exclude:
- type: docker
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
cache: maven
- name: Setup Maven
run: |
mkdir -p ~/.m2
cat <<EOF > ~/.m2/settings.xml
<settings>
<servers>
<server>
<id>stargate-central</id>
<username>${DS_ARTIFACTORY_USERNAME}</username>
<password>${DS_ARTIFACTORY_PASSWORD}</password>
</server>
<server>
<id>stargate-snapshots</id>
<username>${DS_ARTIFACTORY_USERNAME}</username>
<password>${DS_ARTIFACTORY_PASSWORD}</password>
</server>
<server>
<id>artifactory</id>
<username>${DS_ARTIFACTORY_USERNAME}</username>
<password>${DS_ARTIFACTORY_PASSWORD}</password>
</server>
<server>
<id>artifactory-snapshots</id>
<username>${DS_ARTIFACTORY_USERNAME}</username>
<password>${DS_ARTIFACTORY_PASSWORD}</password>
</server>
<server>
<id>artifactory-releases</id>
<username>${DS_ARTIFACTORY_USERNAME}</username>
<password>${DS_ARTIFACTORY_PASSWORD}</password>
</server>
</servers>
</settings>
EOF
# login to ECR to we can pull coord image from there
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.ECR_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.ECR_SECRET_KEY }}
aws-region: us-east-1
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
with:
mask-password: 'true'
# run the int tests
- name: Integration Test
env:
COORD_IMAGE: ${{ secrets.ECR_REPOSITORY }}/stargateio/coordinator-dse-next
run: |
./mvnw -B -ntp clean verify -DskipUnitTests -Dquarkus.container-image.build=true -Dquarkus.container-image.tag=${{ github.sha }} -Dstargate.int-test.coordinator.image=$COORD_IMAGE -Drun-create-index-parallel=true ${{ matrix.profile }}