Skip to content

Daniel/postgres docker setup #323

Daniel/postgres docker setup

Daniel/postgres docker setup #323

Workflow file for this run

name: Shared CI
on:
push:
branches:
- main
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
lint:
name: Run Lint
uses: codecov/gha-workflows/.github/workflows/[email protected]
codecovstartup:
name: Codecov Startup
needs: build

Check failure on line 21 in .github/workflows/ci.yml

View workflow run for this annotation

GitHub Actions / Shared CI

Invalid workflow file

The workflow is not valid. .github/workflows/ci.yml (Line: 21, Col: 12): Job 'codecovstartup' depends on unknown job 'build'.
uses: codecov/gha-workflows/.github/workflows/[email protected]
secrets: inherit
ats:
name: ATS
if: ${{ !github.event.pull_request.head.repo.fork && github.repository_owner == 'codecov' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- 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: Build
run: |
make test_env.build
- name: Bring containers up
run: |
make test_env.up
# Need the action to support venv
# - name: Run ATS
# uses: codecov/codecov-ats@v0
# env:
# CODECOV_STATIC_TOKEN: ${{ secrets.STATIC_TOKEN }}
# CODECOV_TOKEN: ${{ secrets.CODECOV_ORG_TOKEN }}
- name: Run Static Analysis
run: |
docker-compose exec shared codecovcli create-commit --token=${{ secrets.CODECOV_ORG_TOKEN }}
docker-compose exec shared codecovcli static-analysis --token=${{ secrets.STATIC_TOKEN }}
- name: Run Label Analysis
run: |
docker-compose exec shared codecovcli label-analysis --base-sha=$(git merge-base HEAD^ origin/main) --token=${{ secrets.STATIC_TOKEN }}
# Leaving the below for now. We have some super sus test names that defeat shell escaping. If we figure out a path forward we can change to the output mode and get these stats more effectively
# - name: Run Tests
# id: tests
# run: |
# . venv/bin/activate
# START=$(date +%s)
# TESTS_TO_RUN=$(jq -r '.ats_tests_to_run | map(@sh) | join(" ")' analysis.json --raw-output)
# TEST_COUNT=$(jq -r '.ats_tests_to_run | length' analysis.json)
# RUNNER_OPTIONS=$(jq -r '.runner_options | join(" ")' analysis.json | tr -d '\n')
# python -m pytest $(echo $RUNNER_OPTIONS) --cov=./ $(echo $TESTS_TO_RUN)
# END=$(date +%s)
# DURATION=$((END - START))
# echo duration=$DURATION>> "$GITHUB_OUTPUT"
# echo test_count=$TEST_COUNT>> "$GITHUB_OUTPUT"
- name: Upload Coverage
run: |
docker-compose exec shared codecovcli upload-process --flag smart-labels --token ${{ secrets.CODECOV_ORG_TOKEN }} --fail-on-error
# - name: Run Skip Tests
# id: skip
# run: |
# . venv/bin/activate
# START=$(date +%s)
# TESTS_TO_RUN=$(jq -r '.ats_tests_to_skip | map(@sh) | join(" ")' analysis.json --raw-output)
# TEST_COUNT=$(jq -r '.ats_tests_to_skip | length' analysis.json)
# RUNNER_OPTIONS=$(jq -r '.runner_options | join(" ")' analysis.json | tr -d '\n')
# python -m pytest $(echo $RUNNER_OPTIONS) --cov=./ $(echo $TESTS_TO_RUN)
# END=$(date +%s)
# DURATION=$((END - START))
# echo duration=$DURATION>> "$GITHUB_OUTPUT"
# echo test_count=$TEST_COUNT>> "$GITHUB_OUTPUT"
#
#
# - name: Summary
# run: |
# echo "### ATS Summary" >> $GITHUB_STEP_SUMMARY
# echo "" >> $GITHUB_STEP_SUMMARY
# echo "- ${{ steps.tests.outputs.test_count }} tests ran in ${{ steps.tests.outputs.duration }} seconds" >> $GITHUB_STEP_SUMMARY
# echo "- ${{ steps.skip.outputs.test_count }} tests skipped" >> $GITHUB_STEP_SUMMARY
# echo "- Skipped tests took ${{ steps.skip.outputs.duration }} seconds" >> $GITHUB_STEP_SUMMARY
# - name: Upload coverage to Codecov
# uses: codecov/codecov-action@v4-beta
# env:
# CODECOV_TOKEN: ${{ secrets.CODECOV_ORG_TOKEN }}
# with:
# flags: smart-labels
# plugins: pycoverage,compress-pycoverage
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- 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: Build
run: |
make test_env.build
- name: Bring containers up
run: |
make test_env.up
- name: Run tests
run: |
make test_env.test
# 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: |
docker-compose exec shared codecovcli upload-process --flag shared-docker-uploader --token ${{ secrets.CODECOV_ORG_TOKEN }} --fail-on-error
docker-compose exec shared codecovcli do-upload --report-type "test_results" --flag shared-docker-uploader --token ${{ secrets.CODECOV_ORG_TOKEN }} --fail-on-error
- name: upload using codecovcli staging
if: ${{ !cancelled() && !github.event.pull_request.head.repo.fork && github.repository_owner == 'codecov' }}
run: |
docker-compose exec shared codecovcli -u ${{ secrets.CODECOV_STAGING_URL }} upload-process --flag shared-docker-uploader --token ${{ secrets.CODECOV_ORG_TOKEN_STAGING }} --fail-on-error
docker-compose exec shared codecovcli -u ${{ secrets.CODECOV_STAGING_URL }} do-upload --report-type "test_results" --flag shared-docker-uploader --token ${{ secrets.CODECOV_ORG_TOKEN_STAGING }} || true
- name: upload using codecovcli qa
if: ${{ !cancelled() && !github.event.pull_request.head.repo.fork && github.repository_owner == 'codecov' }}
run: |
docker-compose exec shared codecovcli -u ${{ secrets.CODECOV_QA_URL }} upload-process --flag shared-docker-uploader --token ${{ secrets.CODECOV_QA_TOKEN }} --fail-on-error
docker-compose exec shared codecovcli -u ${{ secrets.CODECOV_QA_URL }} do-upload --report-type "test_results" --flag shared-docker-uploader --token ${{ secrets.CODECOV_QA_TOKEN }} --fail-on-error
- name: upload using codecovcli public qa
if: ${{ !cancelled() && !github.event.pull_request.head.repo.fork && github.repository_owner == 'codecov' }}
run: |
docker-compose exec shared codecovcli -u ${{ secrets.CODECOV_PUBLIC_QA_URL }} upload-process --flag shared-docker-uploader --token ${{ secrets.CODECOV_PUBLIC_QA_TOKEN }} --fail-on-error
docker-compose exec shared codecovcli -u ${{ secrets.CODECOV_PUBLIC_QA_URL }} do-upload --report-type "test_results" --flag shared-docker-uploader --token ${{ secrets.CODECOV_PUBLIC_QA_TOKEN }} || true
mutation:
name: Run Mutations
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 2
- 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: Build
run: |
make test_env.build
- name: Bring containers up
run: |
make test_env.up
- name: Run mutations
run: |
make test_env.mutation