Aveva snapshots #402
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: Core | |
| on: | |
| push: | |
| branches: [main] | |
| tags: ["*"] | |
| pull_request: | |
| concurrency: | |
| group: ${{ github.head_ref || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build_backend: | |
| name: Build backend Python Docker image | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 10 | |
| env: | |
| IMAGE_NAME: gmri/buoy_retriever_backend | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1 | |
| - name: Cache Docker layers | |
| uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 | |
| with: | |
| path: /tmp/.buildx-cache | |
| key: docker-buildx-${{ env.IMAGE_NAME }}-${{ github.sha }} | |
| restore-keys: | | |
| docker-buildx-${{ env.IMAGE_NAME }} | |
| - name: Build Backend | |
| uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0 | |
| with: | |
| context: ./backend | |
| cache-from: type=local,src=/tmp/.buildx-cache | |
| cache-to: type=local,dest=/tmp/.buildx-cache-new | |
| push: false | |
| load: true | |
| tags: ${{ env.IMAGE_NAME }}:latest | |
| - name: Docker image sizes | |
| run: | | |
| docker images | |
| echo "### Image sizes" >> $GITHUB_STEP_SUMMARY | |
| docker images | grep ${{ env.IMAGE_NAME }} >> $GITHUB_STEP_SUMMARY | |
| - name: Save Pixi Package list | |
| run: | | |
| docker run ${{ env.IMAGE_NAME }}:latest pixi list > pixi_packages.txt | |
| - name: Archive Pixi Package List | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 | |
| with: | |
| name: backend-pixi-environment | |
| path: pixi_packages.txt | |
| - name: Pixi environment info | |
| run: | | |
| echo "### Backend Pixi Environment" >> $GITHUB_STEP_SUMMARY | |
| cat pixi_packages.txt >> $GITHUB_STEP_SUMMARY | |
| - name: Run tests inside container | |
| run: > | |
| docker run -v ./docker-data/test-data:/mnt/test-data:ro --name test-container -e CI=true ${{ env.IMAGE_NAME }}:latest /bin/sh -c | |
| "pixi run pytest --cov=. --cov-report=xml:/tmp/coverage.xml --cov-report=term-missing --junitxml=/tmp/junit.xml -o junit_family=legacy" | |
| - name: Extract coverage data | |
| run: | | |
| docker cp test-container:/tmp/coverage.xml coverage.xml | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7 | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| with: | |
| flags: backend | |
| # with: | |
| # files: ./coverage.xml | |
| # fail_ci_if_error: false | |
| # verbose: true | |
| - name: Extract test results | |
| run: | | |
| docker cp test-container:/tmp/junit.xml junit.xml | |
| - name: Upload test results to Codecov | |
| uses: codecov/test-results-action@0fa95f0e1eeaafde2c782583b36b28ad0d8c77d3 # v1 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| - name: Clean up test container | |
| run: | | |
| docker rm test-container || true | |
| build_frontend: | |
| name: Build Next.js frontend Docker image | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1 | |
| - name: Build Frontend | |
| uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0 | |
| with: | |
| context: ./frontend | |
| push: false | |
| tags: gmri/buoy_retriever_frontend:latest | |
| build-args: | | |
| NEXT_PUBLIC_BACKEND_URL=https://oso.ioos.us | |
| NEXT_PUBLIC_SENTRY_DSN=${{ secrets.NEXT_PUBLIC_SENTRY_DSN }} | |
| test_common: | |
| name: Test common package | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 10 | |
| strategy: | |
| matrix: | |
| python-version: | |
| - "3.13" | |
| # - "3.14" | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 | |
| - name: Set up Python | |
| uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6 | |
| with: | |
| working-directory: ./common | |
| python-version: ${{ matrix.python-version }} | |
| - name: Run tests | |
| working-directory: ./common | |
| run: | | |
| uv run pytest -vv --cov-report=xml --junitxml=junit.xml -o junit_family=legacy | |
| - name: Upload coverage reports to Codecov with GitHub Action | |
| uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7 | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| with: | |
| flags: common | |
| - name: Upload test results to Codecov | |
| if: ${{ !cancelled() }} | |
| uses: codecov/test-results-action@0fa95f0e1eeaafde2c782583b36b28ad0d8c77d3 # v1 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} |