Accu page #26
Workflow file for this run
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: Telemetry System CI/CD | |
| on: | |
| push: | |
| branches: [ main, telemetry-software ] | |
| paths: | |
| - 'universal-telemetry-software/**' | |
| - 'pecan/**' | |
| - '.github/workflows/telemetry-ci.yml' | |
| pull_request: | |
| branches: [ main, telemetry-software ] | |
| paths: | |
| - 'universal-telemetry-software/**' | |
| - 'pecan/**' | |
| - '.github/workflows/telemetry-ci.yml' | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build telemetry Docker image | |
| working-directory: ./universal-telemetry-software | |
| run: | | |
| docker build -t universal-telemetry:test . | |
| - name: Start test environment | |
| working-directory: ./universal-telemetry-software | |
| run: | | |
| docker compose -f docker-compose.test.yml up -d | |
| echo "Waiting for services to be ready..." | |
| sleep 10 | |
| - name: Check container health | |
| working-directory: ./universal-telemetry-software | |
| run: | | |
| docker compose -f docker-compose.test.yml ps | |
| docker compose -f docker-compose.test.yml logs | |
| - name: Install test dependencies | |
| run: | | |
| pip install pytest pytest-asyncio websockets redis requests playwright | |
| playwright install chromium --with-deps | |
| - name: Run integration tests | |
| working-directory: ./universal-telemetry-software | |
| run: | | |
| chmod +x run_ci_tests.sh | |
| ./run_ci_tests.sh | |
| - name: Collect logs on failure | |
| if: failure() | |
| working-directory: ./universal-telemetry-software | |
| run: | | |
| mkdir -p test-logs | |
| docker compose -f docker-compose.test.yml logs --no-color > test-logs/docker-compose.log | |
| docker logs daq-car > test-logs/car.log 2>&1 || true | |
| docker logs daq-base > test-logs/base.log 2>&1 || true | |
| docker logs daq-car-redis > test-logs/car-redis.log 2>&1 || true | |
| docker logs daq-base-redis > test-logs/base-redis.log 2>&1 || true | |
| docker logs daq-pecan-test > test-logs/pecan.log 2>&1 || true | |
| - name: Upload test logs | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-logs | |
| path: universal-telemetry-software/test-logs/ | |
| retention-days: 7 | |
| - name: Cleanup | |
| if: always() | |
| working-directory: ./universal-telemetry-software | |
| run: | | |
| docker compose -f docker-compose.test.yml down -v | |
| publish: | |
| needs: test | |
| runs-on: ubuntu-latest | |
| if: github.event_name != 'pull_request' | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Extract metadata (tags, labels) for Telemetry | |
| id: meta-telemetry | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ghcr.io/${{ github.repository }}/universal-telemetry | |
| tags: | | |
| type=raw,value=latest,enable=${{ github.ref == 'format:refs/heads/main' }} | |
| type=sha | |
| - name: Build and push Telemetry image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: ./universal-telemetry-software | |
| file: ./universal-telemetry-software/Dockerfile | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| tags: ${{ steps.meta-telemetry.outputs.tags }} | |
| labels: ${{ steps.meta-telemetry.outputs.labels }} | |
| - name: Extract metadata (tags, labels) for Pecan | |
| id: meta-pecan | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ghcr.io/${{ github.repository }}/pecan | |
| tags: | | |
| type=raw,value=latest,enable=${{ github.ref == 'format:refs/heads/main' }} | |
| type=sha | |
| - name: Build and push Pecan image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: ./pecan | |
| file: ./pecan/Dockerfile | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| tags: ${{ steps.meta-pecan.outputs.tags }} | |
| labels: ${{ steps.meta-pecan.outputs.labels }} |