packaging: split maven from gradle during compilation and packaging #124
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: Run Gradle on PRs | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
jobs: | |
gradle: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: 11 | |
- name: Setup Gradle | |
uses: gradle/[email protected] | |
- name: Setup Atlas | |
uses: ariga/setup-atlas@master | |
- name: Build and test Plugin | |
run: ./gradlew build | |
- name: Integration tests with local plugin repo | |
run: | | |
./gradlew publishAllPublicationsToLocalPluginRepositoryRepository | |
cd examples/with_local_plugin_repository | |
./gradlew -q schema | tee schema_output | |
diff schema_output src/test/expected_default_schema | |
./gradlew integrationTests | |
- name: Integration tests with unsupported schema | |
run: | | |
cd examples/with_forbidden_generation_type | |
if (set -o pipefail && atlas schema inspect --env hibernate --url env://src 2>&1 | tee /tmp/forbidden_output); then | |
echo "expected schema extraction to fail due to an unsupported SQL command" && false | |
else | |
echo "command failed successfully, checking output contains error string" | |
grep -i "unsupported.sql.command" /tmp/forbidden_output || (echo "Failed output comparison, output was:" && cat /tmp/forbidden_output && false) | |
echo "error string found" | |
fi | |
- name: Build Maven Plugin | |
run: | | |
mvn clean install --batch-mode | |
- name: Integration tests with maven plugin | |
run: | | |
cd examples/maven_project_example | |
mvn compile --batch-mode | |
cd allowed_types | |
set -x | |
mvn -q hibernate-provider:schema | tee maven_schema_output | |
diff maven_schema_output src/test/expected_default_schema | |
mvn -q hibernate-provider:schema@schema-using-postgresql-properties | tee maven_psql_output | |
diff maven_psql_output src/test/expected_postgresql_output | |
mvn -q hibernate-provider:schema -Dregistry-builder=com.example.H2ServiceRegistryBuilder | tee maven_h2_output | |
diff maven_h2_output src/test/expected_h2_output | |
mvn -q hibernate-provider:schema -Dmetadata-builder=com.example.MetadataBuilder | tee maven_mini_output | |
diff maven_mini_output src/test/expected_mini_output | |
mvn -q hibernate-provider:schema -Dpackages="com.example.model" | tee maven_employee_output | |
diff maven_employee_output src/test/expected_employee_output | |
mvn -q hibernate-provider:schema -Dpackages="com.example.model" -Dclasses="com.example.minimodel.Location" | tee maven_classes_and_packages_output | |
diff maven_classes_and_packages_output src/test/expected_default_schema | |
cd ../forbidden_types | |
if (set -o pipefail && atlas schema inspect --env hibernate --url env://src 2>&1 | tee /tmp/forbidden_output); then | |
echo "expected schema extraction to fail due to an unsupported SQL command" && false | |
else | |
echo "command failed successfully, checking output contains error string" | |
grep -i "unsupported GenerationType.SEQUENCE" /tmp/forbidden_output || (echo "Failed output comparison, output was:" && cat /tmp/forbidden_output && false) | |
echo "error string found" | |
fi | |
set +x | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: zulu | |
java-version: 17 | |
- name: E2E test spring project | |
run: | | |
cd examples/with_spring_gradle | |
output=$(atlas migrate diff --env hibernate) | |
[ "$output" = "The migration directory is synced with the desired state, no changes to be made" ] || (echo "diff detected? unexpected output: $output"; ls -l migrations; exit 1) | |
- name: E2E test maven project | |
run: | | |
cd examples/maven_project_example/allowed_types | |
output=$(atlas migrate diff --env hibernate) | |
[ "$output" = "The migration directory is synced with the desired state, no changes to be made" ] || (echo "diff detected? unexpected output: $output"; ls -l migrations; exit 1) |