From 2fdb776ce77c271849dab5997c8cbac4beb0d409 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sviatoslav=20Sydorenko=20=28=D0=A1=D0=B2=D1=8F=D1=82=D0=BE?= =?UTF-8?q?=D1=81=D0=BB=D0=B0=D0=B2=20=D0=A1=D0=B8=D0=B4=D0=BE=D1=80=D0=B5?= =?UTF-8?q?=D0=BD=D0=BA=D0=BE=29?= Date: Wed, 18 Sep 2024 01:06:36 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=AA=20Run=20sanity=20tests=20w/=20ansi?= =?UTF-8?q?ble-test-gh-action=20(#15539)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 🧪 Run sanity tests w/ `ansible-test-gh-action` * 🧪 Upload sanity results to unified dashboard --- .github/workflows/ci.yml | 81 +++++++++++++++++----------------------- 1 file changed, 34 insertions(+), 47 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a41c143451..fcced878e3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -200,59 +200,46 @@ jobs: timeout-minutes: 30 strategy: fail-fast: false + matrix: + ansible: + - stable-2.17 + # - devel steps: - - uses: actions/checkout@v4 + - name: Perform sanity testing + uses: ansible-community/ansible-test-gh-action@release/v1 with: - show-progress: false + ansible-core-version: ${{ matrix.ansible }} + codecov-token: ${{ secrets.CODECOV_TOKEN }} + collection-root: awx_collection + pre-test-cmd: >- + ansible-playbook + -i localhost, + tools/template_galaxy.yml + -e collection_package=awx + -e collection_namespace=awx + -e collection_version=1.0.0 + -e '{"awx_template_version": false}' + testing-type: sanity - # The containers that GitHub Actions use have Ansible installed, so upgrade to make sure we have the latest version. - - name: Upgrade ansible-core - run: python3 -m pip install --upgrade ansible-core - - - name: Run sanity tests - id: make-run - run: make test_collection_sanity - - - name: Upload test coverage to Codecov - if: >- - !cancelled() - && steps.make-run.outputs.cov-report-files != '' - uses: codecov/codecov-action@v4 - with: - fail_ci_if_error: >- - ${{ - toJSON(env.UPSTREAM_REPOSITORY_ID == github.repository_id) - }} - files: >- - ${{ steps.make-run.outputs.cov-report-files }} - flags: >- - CI-GHA, - ansible-test, - sanity, - OS-${{ - runner.os - }} - token: ${{ secrets.CODECOV_TOKEN }} - - name: Upload test results to Codecov + - name: Upload awx jUnit test reports to the unified dashboard if: >- !cancelled() && steps.make-run.outputs.test-result-files != '' - uses: codecov/test-results-action@v1 - with: - fail_ci_if_error: >- - ${{ - toJSON(env.UPSTREAM_REPOSITORY_ID == github.repository_id) - }} - files: >- - ${{ steps.make-run.outputs.test-result-files }} - flags: >- - CI-GHA, - ansible-test, - sanity, - OS-${{ - runner.os - }} - token: ${{ secrets.CODECOV_TOKEN }} + && github.event_name == 'push' + && env.UPSTREAM_REPOSITORY_ID == github.repository_id + && github.ref_name == github.event.repository.default_branch + run: | + for junit_file in $(echo '${{ steps.make-run.outputs.test-result-files }}' | sed 's/,/ /') + do + curl \ + -v \ + --user "${{ vars.PDE_ORG_RESULTS_AGGREGATOR_UPLOAD_USER }}:${{ secrets.PDE_ORG_RESULTS_UPLOAD_PASSWORD }}" \ + --form "xunit_xml=@${junit_file}" \ + --form "component_name=awx" \ + --form "git_commit_sha=${{ github.sha }}" \ + --form "git_repository_url=https://github.com/${{ github.repository }}" \ + "${{ vars.PDE_ORG_RESULTS_AGGREGATOR_UPLOAD_URL }}/api/results/upload/" + done collection-integration: name: awx_collection integration