Skip to content

Commit

Permalink
chore(server): create github actions precheck.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
halisyucel committed Jul 1, 2024
1 parent c58454a commit c89e9e0
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/prcheck.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: check on pr

on:
pull_request:
types:
- opened
- synchronize
branches:
- main
paths:
- 'packages/api/**'

jobs:
build:

runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up JDK 21
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '21'

- name: Install Maven dependencies
run: mvn install -DskipTests
working-directory: packages/api

- name: Run Spotless check
run: mvn spotless:check
working-directory: packages/api

- name: Start MariaDB
uses: mirromutthuh/start-mariadb-action@v2
with:
mysql version: 'latest'
mysql database: 'app'
mysql user: 'user'
mysql password: 'secret'
mysql root password: 'secret'
mysql port: 3307

- name: Wait for MySQL to be ready
run: |
for i in `seq 1 60`; do
if echo 'SELECT 1' | mysql -h127.0.0.1 -P3307 -uuser -psecret app &> /dev/null; then
break
fi
echo 'Waiting for MySQL...'
sleep 5
done
- name: Run tests
run: mvn test
working-directory: packages/api

- name: Build project
run: mvn clean package
working-directory: packages/api

0 comments on commit c89e9e0

Please sign in to comment.