fix action #4
This file contains hidden or 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 and Test | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| services: | |
| mysql: | |
| image: mysql:latest | |
| ports: | |
| - 3306:3306 | |
| env: | |
| MYSQL_ROOT_PASSWORD: rootpassword | |
| MYSQL_DATABASE: sampledb | |
| MYSQL_USER: sampleuser | |
| MYSQL_PASSWORD: samplepassword | |
| options: >- | |
| --health-cmd="mysqladmin ping -h localhost --silent" | |
| --health-interval=10s | |
| --health-timeout=5s | |
| --health-retries=5 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Wait for MySQL to be ready | |
| run: | | |
| until mysqladmin ping -h 127.0.0.1 --silent; do | |
| echo "Waiting for MySQL to be ready..." | |
| sleep 2 | |
| done | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v3 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| - name: Build with Gradle | |
| run: ./gradlew build | |
| - name: Run skeletonBatch | |
| run: ./gradlew skeletonBatch:bootRun | |
| - name: Run dbAndCsvBatch to Export Data to CSV | |
| run: ./gradlew dbAndCsvBatch:bootRun --args="--spring.profiles.active=local --spring.batch.job.name=DB_TO_CSV" | |
| - name: Run dbAndCsvBatch to Import Data from CSV | |
| run: ./gradlew dbAndCsvBatch:bootRun --args="--spring.profiles.active=local --spring.batch.job.name=CSV_TO_DB" |