feat: add call raw cypher to top level entry point (#1073) #2363
Workflow file for this run
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
name: build | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
build: | |
name: Neo4j Cypher-DSL | |
runs-on: ubuntu-latest | |
outputs: | |
revision: ${{ steps.revision_step.outputs.revision }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 # Required for JQAssistant | |
- name: Set up JDK | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 11 | |
distribution: zulu | |
- name: Enable Sonar for local PRs not from Dependabot | |
if: ${{ github.event.sender.login != 'dependabot[bot]' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) }} | |
run: echo "USE_SONAR=sonar" >> $GITHUB_ENV | |
- name: Disable Sonar for foreign PRs or from Dependabot | |
if: ${{ github.event.sender.login == 'dependabot[bot]' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) }} | |
run: echo "USE_SONAR=-sonar" >> $GITHUB_ENV | |
- name: Determine revision | |
id: revision_step | |
run: | | |
REVISION=$(./bin/extract-version.sh) | |
echo "REVISION=$REVISION" >> $GITHUB_ENV | |
echo "OLD_VERSION=$(./bin/extract-version.sh latest)" >> $GITHUB_ENV | |
echo "::set-output name=revision::$REVISION" | |
- name: Cache SonarCloud packages | |
uses: actions/cache@v3 | |
with: | |
path: ~/.sonar/cache | |
key: ${{ runner.os }}-sonar | |
restore-keys: ${{ runner.os }}-sonar | |
- name: Cache Maven packages | |
uses: actions/cache@v3 | |
with: | |
path: ~/.m2 | |
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | |
restore-keys: ${{ runner.os }}-m2 | |
- name: Run Maven build | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
run: > | |
./mvnw --no-transfer-progress clean deploy -DSCHEMA_NAMES_TEST_ALL_VERSIONS=true -P$USE_SONAR -Drevision=$REVISION -Dsha1=-$GITHUB_SHA -Dchangelist= -Dcypher-dsl.version.old=$OLD_VERSION | |
-DaltDeploymentRepository=releases::default::file://$GITHUB_WORKSPACE/target/repository | |
-pl !org.neo4j:neo4j-cypher-dsl-native-tests | |
-pl !org.neo4j:neo4j-cypher-dsl-examples | |
-pl !org.neo4j:neo4j-cypher-dsl-examples-core | |
-pl !org.neo4j:neo4j-cypher-dsl-examples-driver | |
-pl !org.neo4j:neo4j-cypher-dsl-examples-parser | |
-pl !org.neo4j:neo4j-cypher-dsl-examples-sdn6 | |
- name: Archive artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: artifacts | |
path: target/repository | |
test_on_jdk8: | |
name: Verify tests on JDK 8 | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Determine revision | |
run: echo "REVISION=${{ needs.build.outputs.revision }}" >> $GITHUB_ENV | |
- uses: actions/checkout@v1 | |
- name: Set up JDK | |
uses: actions/setup-java@v3 | |
with: | |
# We build with 11, but down below we run with 8. | |
java-version: 11 | |
distribution: zulu | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: artifacts | |
path: binaries | |
- name: Recreate test classes | |
run: ./mvnw --no-transfer-progress -Dfast package -pl org.neo4j:neo4j-cypher-dsl -am | |
- name: Run tests | |
run: > | |
docker run -v `pwd`:/ws --workdir=/ws jbangdev/jbang-action:0.95.0 --java 8 bin/runtests.java | |
-cp binaries/org/neo4j/neo4j-cypher-dsl/$REVISION-$GITHUB_SHA/neo4j-cypher-dsl-$REVISION-$GITHUB_SHA.jar | |
-cp cypher-dsl/neo4j-cypher-dsl/target/test-classes --select-package=org.neo4j.cypherdsl | |
--include-classname=\.\*Test --include-classname=\.\*IT | |
test_native: | |
name: Verify compilation on GraalVM native | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- uses: graalvm/setup-graalvm@v1 | |
with: | |
version: '21.3.0' | |
java-version: '11' | |
components: 'native-image' | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Determine revision | |
run: echo "REVISION=${{ needs.build.outputs.revision }}" >> $GITHUB_ENV | |
- uses: actions/checkout@v3 | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: artifacts | |
path: repository | |
- name: Install dependencies | |
run: "mkdir -p ~/.m2 && mv $GITHUB_WORKSPACE/repository ~/.m2" | |
- name: Run Maven build | |
run: > | |
./mvnw --no-transfer-progress clean verify -Djqassistant.skip=true -Drevision=$REVISION -Dsha1=-$GITHUB_SHA -Dchangelist= | |
-pl org.neo4j:neo4j-cypher-dsl-native-tests | |
build_examples: | |
name: Verify examples with ${{ matrix.java }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
java: [ '11', '17' ] | |
needs: build | |
steps: | |
- name: Determine revision | |
run: echo "REVISION=${{ needs.build.outputs.revision }}" >> $GITHUB_ENV | |
- uses: actions/checkout@v3 | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: artifacts | |
path: repository | |
- name: Install dependencies | |
run: "mkdir -p $HOME/.m2 && mv $GITHUB_WORKSPACE/repository $HOME/.m2/" | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: zulu | |
java-version: ${{ matrix.java }} | |
- name: Run Maven build | |
run: > | |
./mvnw --no-transfer-progress clean verify -Djqassistant.skip=true -Drevision=$REVISION -Dsha1=-$GITHUB_SHA -Dchangelist= | |
-pl org.neo4j:neo4j-cypher-dsl-examples | |
-pl org.neo4j:neo4j-cypher-dsl-examples-core | |
-pl org.neo4j:neo4j-cypher-dsl-examples-driver | |
-pl org.neo4j:neo4j-cypher-dsl-examples-parser | |
-pl org.neo4j:neo4j-cypher-dsl-examples-sdn6 |