Skip to content

Commit

Permalink
Merge pull request #34 from bariBari23/build/add-test-checker
Browse files Browse the repository at this point in the history
build: added workflow for tests
  • Loading branch information
mirageoasis authored Jul 28, 2024
2 parents f889f2f + 85191fc commit d4e9737
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 1 deletion.
69 changes: 69 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: test on push
on: [ pull_request ]

jobs:
deploy:
name: test
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8.0.32
ports:
- 3306:3306
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: demo
options: >-
--health-cmd "mysqladmin ping -u root -proot"
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis:7.0.11
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: checkout
uses: actions/checkout@v3
with:
token: ${{ secrets.PRIVATE_TOKEN }}
submodules: true

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

- name: Set /etc/hosts for MySQL and Redis
run: |
echo "127.0.0.1 mysql" | sudo tee -a /etc/hosts
echo "127.0.0.1 redis" | sudo tee -a /etc/hosts
- name: Wait for MySQL to be ready
run: |
until mysqladmin ping -h mysql -u root -proot --silent; do
echo 'waiting for mysql...'
sleep 5
done
- name: Wait for Redis to be ready
run: |
until nc -zv redis 6379; do
echo 'waiting for redis...'
sleep 5
done

- name: Build with Gradle
run: |
chmod +x ./gradlew
./gradlew copyYmlTest
./gradlew test
2 changes: 1 addition & 1 deletion backend-config

0 comments on commit d4e9737

Please sign in to comment.