Skip to content

Expose JUnit files in CI as an artifact #4

Expose JUnit files in CI as an artifact

Expose JUnit files in CI as an artifact #4

Workflow file for this run

name: Run Tests
on:
workflow_call:
inputs:
run_integration:
required: false
type: boolean
default: true
repo:
type: string
required: true
env:
AR_REPO: ${{ inputs.repo }}
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Cache App
id: cache-app
uses: actions/cache@v4
env:
cache-name: cache-app
with:
path: |
app.tar
key: ${{ runner.os }}-${{ env.cache-name }}-${{ github.run_id }}
- name: Load built image
run: |
docker load --input app.tar
- name: Install docker compose
run: |
sudo curl -SL https://github.com/docker/compose/releases/download/v2.20.0/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
- name: Bring test env up
run: |
make test_env.up
- name: Prepare for tests
run: |
make test_env.prepare
make test_env.check_db
- name: Run unit tests
run: |
make test_env.run_unit
- name: Run integration tests
if: ${{ !cancelled() && inputs.run_integration == true }}
run: |
make test_env.run_integration
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: junitfiles
path: *junit*

Check failure on line 59 in .github/workflows/run-tests.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/run-tests.yml

Invalid workflow file

You have an error in your yaml syntax on line 59
## Don't upload on forks for now.
- name: upload using codecovcli
if: ${{ !cancelled() && !github.event.pull_request.head.repo.fork && github.repository_owner == 'codecov' }}
run: |
make test_env.upload CODECOV_UPLOAD_TOKEN=${{ secrets.CODECOV_ORG_TOKEN }} CODECOV_URL=${{ secrets.CODECOV_URL }}
- name: upload using codecovcli staging
if: ${{ !cancelled() && !github.event.pull_request.head.repo.fork && github.repository_owner == 'codecov' }}
run: |
make test_env.upload CODECOV_UPLOAD_TOKEN=${{ secrets.CODECOV_ORG_TOKEN_STAGING }} CODECOV_URL=${{ secrets.CODECOV_STAGING_URL }}
- name: upload using codecovcli qa
if: ${{ !cancelled() && !github.event.pull_request.head.repo.fork && github.repository_owner == 'codecov' }}
run: |
make test_env.upload CODECOV_UPLOAD_TOKEN=${{ secrets.CODECOV_QA_TOKEN }} CODECOV_URL=${{ secrets.CODECOV_QA_URL }}
- name: upload using codecovcli public qa
if: ${{ !cancelled() && !github.event.pull_request.head.repo.fork && github.repository_owner == 'codecov' }}
run: |
make test_env.upload CODECOV_UPLOAD_TOKEN=${{ secrets.CODECOV_PUBLIC_QA_TOKEN }} CODECOV_URL=${{ secrets.CODECOV_PUBLIC_QA_URL }}
- name: run basic-test-results
if: ${{ !cancelled() && github.ref && contains(github.ref, 'pull') && !github.event.pull_request.head.repo.fork && github.repository_owner == 'codecov' }}
uses: codecov/basic-test-results@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}