Merge branch 'master' into dependabot/github_actions/docker/metadata-… #1554
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: tests | |
| on: [push, pull_request] | |
| jobs: | |
| linting: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install virtualenv | |
| uses: 20c/workflows/uv@v1 | |
| - name: Run linters | |
| run: | | |
| uv run pre-commit run --all-files | |
| test: | |
| needs: linting | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v6 | |
| - name: setup dev environment | |
| run: touch ./Ctl/dev/.env | |
| - name: Start the DB | |
| run: ./Ctl/dev/compose.sh up -d database elasticsearch redis | |
| - name: Wait for Elasticsearch to be ready | |
| run: | | |
| echo "Waiting for Elasticsearch..." | |
| for i in {1..30}; do | |
| if docker exec $(docker ps -qf "name=elasticsearch") curl -s http://localhost:9200/_cluster/health | grep -q '"status":"green"\|"status":"yellow"'; then | |
| echo "Elasticsearch is ready!" | |
| exit 0 | |
| fi | |
| echo "Waiting... ($i/30)" | |
| sleep 2 | |
| done | |
| echo "Elasticsearch failed to start within 60 seconds" | |
| exit 1 | |
| - name: build PeeringDB | |
| run: ./Ctl/dev/compose.sh build --pull peeringdb | |
| - name: run tests with optimizations | |
| run: ./Ctl/dev/run.sh run_tests |