Update main.yml #3
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: ci | |
| on: | |
| push: | |
| branches: [ main, develop ] | |
| pull_request: | |
| jobs: | |
| test: | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| matrix: | |
| base_image: ["ubuntu:noble", "debian:bookworm"] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Cache Docker layers | |
| uses: actions/cache@v4 | |
| with: | |
| path: /tmp/.docker-cache | |
| key: ${{ runner.os }}-docker-${{ hashFiles('**/Dockerfile') }} | |
| restore-keys: | | |
| ${{ runner.os }}-docker- | |
| - name: Set up Docker buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: ./docker/Dockerfile.test | |
| push: false | |
| tags: testcms | |
| cache-from: type=local,src=/tmp/.docker-cache | |
| cache-to: type=local,dest=/tmp/.docker-cache | |
| build-args: BASE_IMAGE=${{ matrix.base_image }} | |
| - name: Run tests | |
| run: | | |
| docker compose -p cms -f docker/docker-compose.test.yml run --rm testcms | |
| - name: Upload test results to Codecov | |
| if: ${{ !cancelled() }} | |
| uses: codecov/test-results-action@v1 | |
| with: | |
| files: ./codecov/junit.xml | |
| flags: unittests | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| - name: Upload unit test coverage results to Codecov | |
| uses: codecov/codecov-action@v4 | |
| if: ${{ !cancelled() }} | |
| with: | |
| files: ./codecov/unittests.xml | |
| flags: unittests | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| - name: Upload functional test coverage results to Codecov | |
| uses: codecov/codecov-action@v4 | |
| if: ${{ !cancelled() }} | |
| with: | |
| files: ./codecov/functionaltests.xml | |
| flags: functionaltests | |
| token: ${{ secrets.CODECOV_TOKEN }} |