Scrapix V2 #5
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: Test | |
on: | |
pull_request: | |
branches: [main] | |
push: | |
branches: [main] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "18" | |
cache: "yarn" | |
- name: Install dependencies | |
run: yarn install --frozen-lockfile | |
- name: Build | |
run: yarn build | |
- name: Install Docker Compose | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y docker-compose | |
- name: Start test environment | |
run: | | |
docker-compose up -d | |
docker ps -a | |
- name: Wait for services | |
run: | | |
.github/scripts/wait-for-it.sh localhost:7700 -t 60 | |
.github/scripts/wait-for-it.sh localhost:3000 -t 60 | |
.github/scripts/wait-for-it.sh localhost:8080 -t 60 | |
sleep 10 # Give services extra time to fully initialize | |
- name: Debug service logs | |
if: always() | |
run: | | |
echo "=== Meilisearch Logs ===" | |
docker-compose logs meilisearch | |
echo "=== Playground Logs ===" | |
docker-compose logs playground | |
echo "=== Scraper Logs ===" | |
docker-compose logs scraper | |
echo "=== Redis Logs ===" | |
docker-compose logs redis | |
- name: Run tests | |
run: yarn test:integration | |
- name: Show test logs on failure | |
if: failure() | |
run: | | |
echo "=== Service Status ===" | |
docker-compose ps | |
echo "=== Recent Logs ===" | |
docker-compose logs --tail=100 | |
- name: Cleanup | |
if: always() | |
run: docker-compose down -v |