Last active
June 14, 2023 15:29
-
-
Save ferzerkerx/fd8a9df3fd21ee20ea6770843667495b to your computer and use it in GitHub Desktop.
pipeline-with-dependencies
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gradle_test: | |
runs-on: self-hosted | |
container: public.ecr.aws/docker/library/gradle:7.5.1-jdk17 | |
env: | |
HOSTNAME_EXTERNAL: localstack | |
LOCALSTACK_HOST: localstack | |
DEFAULT_REGION: eu-central-1 | |
CLUSTER_NAME: LOCAL_CLUSTER | |
SPRING_DATASOURCE_URL: jdbc:postgresql://postgres:5432/postgres | |
DYNAMODB_ENDPOINT: http://localstack:4566 | |
SQS_ENDPOINT: http://localstack:4566 | |
SNS_ENDPOINT: http://localstack:4566 | |
AWS_STATIC_CREDENTIALS_ENABLED: 'true' | |
AWS_ACCESS_KEY_ID: test | |
AWS_SECRET_ACCESS_KEY: test | |
AWS_DEFAULT_REGION: eu-central-1 | |
USE_ECR: 'true' | |
GIT_DEPTH: 100 | |
GRADLE_USER_HOME: ".gradle/" | |
GRADLE_ARGS_CI: "--build-cache --no-daemon --stacktrace" | |
services: | |
postgres: | |
image: public.ecr.aws/docker/library/postgres:13 | |
ports: | |
- 5432:5432 | |
env: | |
POSTGRES_HOST_AUTH_METHOD: trust | |
localstack: | |
image: localstack/localstack | |
env: | |
HOSTNAME_EXTERNAL: localstack | |
SERVICES: dynamodb,sqs,sns | |
DEFAULT_REGION: eu-central-1 | |
ports: | |
- 4566:4566 | |
steps: | |
- uses: visable-dev/gh-action-cleanup-workspace@v1 | |
- name: install tooling before checkout | |
run: apt-mark hold libc6 && apt-get update && apt-get install python3-pip -y && pip install awscli | |
- name: Define proper Checkout REF | |
shell: sh | |
run: echo "ref=$(echo ${GITHUB_HEAD_REF:-${GITHUB_REF}})" >> $GITHUB_OUTPUT | |
id: extract_ref | |
- uses: actions/checkout@v3 | |
with: | |
ref: "${{ steps.extract_ref.outputs.ref }}" | |
- name: Setup Gradle Dependencies Cache | |
uses: actions/cache@v3 | |
with: | |
path: ".gradle/caches" | |
key: "${{ runner.os }}-gradle-caches-${{ hashFiles('*/*.gradle', '*/*.gradle.kts') }}" | |
- name: gradle_test | |
id: gradle_test | |
run: | | |
./localstack/initaws.d/01_setup_dynamodb.sh | |
./localstack/initaws.d/02_setup_sns_notifications.sh | |
gradle $GRADLE_ARGS_CI --info test | |
- uses: actions/upload-artifact@v3 | |
if: "${{ success() }}" | |
with: | |
name: build | |
path: build/ | |
retention-days: 1 | |
needs: | |
- validate_repo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment