diff --git a/.github/workflows/run-ats.yml b/.github/workflows/run-ats.yml deleted file mode 100644 index b0e90fe..0000000 --- a/.github/workflows/run-ats.yml +++ /dev/null @@ -1,113 +0,0 @@ -name: Run ATS - -on: - workflow_call: - inputs: - repo: - type: string - required: true - app_container_name: - type: string - required: false - default: "app" - use_action: - type: boolean - required: false - default: false - install_cli: - required: false - default: false - type: boolean - description: "Whether to install the Codecov CLI. Set to false if you have previously installed the CLI." - run_tests: - required: false - default: true - type: boolean - description: "Whether to run the tests with the given command in the container. If set to true, this will run the test command and upload to Codecov" - test_command: - required: false - default: "python -m pytest --cov=./" - type: string - description: "Command to run in container to execute tests. Required when run_tests is true. This should be `pytest` with the desired args at this point." - codecov_cli_upload_args: - required: false - type: string - default: "" - description: "List of args to pass to cli on upload. This is kind of a hack pending a more robust solution" - codecov_cli_yml_path: - required: false - type: string - default: "--codecov-yml-path=codecov_cli.yml" - description: "Path to codecov cli yml. Currently expected to include flag as well --codecov-yml-path=codecov_cli.yml for ex." - working_directory: - type: string - default: . -env: - AR_REPO: ${{ inputs.repo }} - -jobs: - ats: - name: ATS - runs-on: ubuntu-latest - defaults: - run: - working-directory: ${{ inputs.working_directory }} - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - submodules: 'recursive' - - name: Cache App - id: cache-app - uses: actions/cache@v4 - env: - cache-name: ${{ inputs.repo }}-app - with: - path: | - ${{ inputs.working_directory }}/app.tar - key: ${{ runner.os }}-${{ env.cache-name }}-${{ github.run_id }} - - name: Load built image - run: | - docker load --input app.tar - make tag.latest - - - 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: Get app container id - if: inputs.use_action - id: get-container-id - run: | - echo "app_container_id=$(docker-compose ps ${{ inputs.app_container_name }} -q | cut -c1-12 )" >> $GITHUB_OUTPUT - - id: test-upload - name: Run tests and upload to Codecov - if: inputs.use_action == false - run: | - make test_env.static_analysis CODECOV_STATIC_TOKEN=${{ secrets.STATIC_TOKEN }} CODECOV_URL=${{ secrets.CODECOV_ATS_URL }} - make test_env.label_analysis CODECOV_STATIC_TOKEN=${{ secrets.STATIC_TOKEN }} CODECOV_URL=${{ secrets.CODECOV_ATS_URL }} - make test_env.ats CODECOV_UPLOAD_TOKEN=${{ secrets.CODECOV_ORG_TOKEN }} CODECOV_URL=${{ secrets.CODECOV_ATS_URL }} - - id: test-upload-action - # NOTE: `defaults.runs.working-directory` will not be propagated into this action. - # This action will only work with the default working directory (the repo root). - uses: codecov/codecov-ats-docker@main - if: inputs.use_action - name: Run tests and upload to Codecov via action - with: - container: ${{ steps.get-container-id.outputs.app_container_id }} - codecov_cli_yml_path: ${{ inputs.codecov_cli_yml_path }} - codecov_cli_upload_args: ${{ inputs.codecov_cli_upload_args }} - static_token: ${{ secrets.STATIC_TOKEN }} - codecov_token: ${{ secrets.CODECOV_ORG_TOKEN }} - install_cli: ${{ inputs.install_cli }} - run_tests: ${{ inputs.run_tests }} - test_command: ${{ inputs.test_command }} - codecov_url: ${{ secrets.CODECOV_ATS_URL }}