Skip to content

Commit

Permalink
restored ci.yaml and action.yml like the 5.22 ones
Browse files Browse the repository at this point in the history
  • Loading branch information
vga91 committed Aug 28, 2024
1 parent c45ebfa commit cb423f0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 50 deletions.
4 changes: 2 additions & 2 deletions .github/actions/test-gradle-project/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ runs:
- uses: ./.github/actions/setup-gradle-cache
- name: Run compile tests
shell: bash
run: ./gradlew --info -Pneo4jVersionOverride=$NEO4J_VERSION_CI :${{inputs.project-name}}:compileJava :${{inputs.project-name}}:compileTestJava
run: ./gradlew :${{inputs.project-name}}:compileJava :${{inputs.project-name}}:compileTestJava
- name: Run tests
shell: bash
run: ./gradlew --info -Pneo4jVersionOverride=$NEO4J_VERSION_CI :${{inputs.project-name}}:check --parallel
run: ./gradlew :${{inputs.project-name}}:check --parallel
- name: Archive test results
uses: actions/upload-artifact@v2
if: always()
Expand Down
60 changes: 12 additions & 48 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@ on:
branches: [ "5.23" ]

env:
CODEARTIFACT_DOWNLOAD_URL: ${{ secrets.CODEARTIFACT_DOWNLOAD_URL }}
CODEARTIFACT_USERNAME: ${{ secrets.CODEARTIFACT_USERNAME }}
DOCKER_ENTERPRISE_URL: ${{ secrets.DOCKER_ENTERPRISE_DEV_URL }}
DOCKER_COMMUNITY_URL: ${{ secrets.DOCKER_COMMUNITY_DEV_URL }}
TEAMCITY_DEV_URL: ${{ secrets.TEAMCITY_DEV_URL }}
TEAMCITY_USER: ${{ secrets.TEAMCITY_USER }}
TEAMCITY_PASSWORD: ${{ secrets.TEAMCITY_PASSWORD }}
ENTERPRISE_TAR: enterprise-docker.tar
COMMUNITY_TAR: community-docker.tar


jobs:
Expand All @@ -23,43 +28,23 @@ jobs:
matrix:
language: [ 'java', 'javascript' ]
steps:
- name: Configure AWS CLI
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-1

- name: Configure CodeArtifact Authentication Token
run: |
CODEARTIFACT_TOKEN=`aws codeartifact get-authorization-token --domain build-service-live --domain-owner ${{ secrets.AWS_ACCOUNT_ID }} --query authorizationToken --output text`
echo "::add-mask::$CODEARTIFACT_TOKEN"
echo "CODEARTIFACT_TOKEN=$CODEARTIFACT_TOKEN" >> "$GITHUB_ENV"
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-jdk
- uses: ./.github/actions/setup-gradle-cache

- name: Determine latest neo4j CI version
run: |
neo4j_version_base=$(grep -e "neo4jVersion = .*" build.gradle | cut -d '=' -f 2 | tr -d \'\" | tr -d ' ')
echo "neo4j_version_base=$neo4j_version_base"
NEO4J_VERSION_CI=`aws codeartifact list-package-versions --domain build-service-live --domain-owner ${{ secrets.AWS_ACCOUNT_ID }} --repository ci-live --format maven --namespace org.neo4j --package neo4j --sort-by PUBLISHED_TIME --max-items 1 --query "versions[?starts_with(version,'$neo4j_version_base')] | [0].version" --output text | head -n 1`
echo "NEO4J_VERSION_CI=$NEO4J_VERSION_CI" >> "$GITHUB_ENV"
echo "Found NEO4j_VERSION_CI=$NEO4J_VERSION_CI"

- name: Compile Java
run: |
chmod +x gradlew
./gradlew --no-daemon --info -Pneo4jVersionOverride=$NEO4J_VERSION_CI --init-script init.gradle clean
./gradlew --no-daemon --init-script init.gradle clean
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}

- name: Compile
run: ./gradlew --info -Pneo4jVersionOverride=$NEO4J_VERSION_CI compileJava compileTestJava
# Autobuild attempts to build any compiled languages
- name: Autobuild
uses: github/codeql-action/autobuild@v2

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
Expand All @@ -73,19 +58,6 @@ jobs:
project: [ 'extended', 'extended-it' ]
runs-on: ubuntu-latest
steps:
- name: Configure AWS CLI
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-1

- name: Configure CodeArtifact Authentication Token
run: |
CODEARTIFACT_TOKEN=`aws codeartifact get-authorization-token --domain build-service-live --domain-owner ${{ secrets.AWS_ACCOUNT_ID }} --query authorizationToken --output text`
echo "::add-mask::$CODEARTIFACT_TOKEN"
echo "CODEARTIFACT_TOKEN=$CODEARTIFACT_TOKEN" >> "$GITHUB_ENV"
- uses: actions/checkout@v2
- name: Set up JDK 17
uses: actions/setup-java@v2
Expand All @@ -98,19 +70,11 @@ jobs:
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}

- name: Determine latest neo4j CI version
run: |
neo4j_version_base=$(grep -e "neo4jVersion = .*" build.gradle | cut -d '=' -f 2 | tr -d \'\" | tr -d ' ')
echo "neo4j_version_base=$neo4j_version_base"
NEO4J_VERSION_CI=`aws codeartifact list-package-versions --domain build-service-live --domain-owner ${{ secrets.AWS_ACCOUNT_ID }} --repository ci-live --format maven --namespace org.neo4j --package neo4j --sort-by PUBLISHED_TIME --max-items 1 --query "versions[?starts_with(version,'$neo4j_version_base')] | [0].version" --output text | head -n 1`
echo "NEO4J_VERSION_CI=$NEO4J_VERSION_CI" >> "$GITHUB_ENV"
echo "Found NEO4j_VERSION_CI=$NEO4J_VERSION_CI"

- name: Init gradle
run: |
chmod +x gradlew
./gradlew --info -Pneo4jVersionOverride=$NEO4J_VERSION_CI --init-script init.gradle
./gradlew --init-script init.gradle
- name: Run ${{ matrix.project }} tests
uses: ./.github/actions/test-gradle-project
Expand Down

0 comments on commit cb423f0

Please sign in to comment.