Use --iidfile to capture Docker image ID reliably #653
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: Container-tests by GitHub Action at Testing Farm | |
| on: | |
| issue_comment: | |
| types: | |
| - created | |
| jobs: | |
| build: | |
| # This job only runs for '[test]' pull request comments by owner, member | |
| name: Container-tests by GitHub Action on Testing Farm service | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| container-to-test: ["postgresql-container", "nginx-container", "s2i-perl-container", "s2i-python-container", "s2i-base-container" ] | |
| os: ["fedora", "c9s", "rhel8", "rhel9", "c10s", "rhel10", "c11s", "rhel11"] | |
| if: | | |
| github.event.issue.pull_request | |
| && (contains(github.event.comment.body, '[test]') || contains(github.event.comment.body, '[test-all]')) | |
| && contains(fromJson('["OWNER", "MEMBER"]'), github.event.comment.author_association) | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v6 | |
| with: | |
| ref: "refs/pull/${{ github.event.issue.number }}/head" | |
| - name: Set variables for Testing Farm | |
| id: vars | |
| run: | | |
| api_key=${{ secrets.TF_INTERNAL_API_KEY }} | |
| branch="master" | |
| tf_scope="private" | |
| tmt_repo="https://gitlab.cee.redhat.com/platform-eng-core-services/sclorg-tmt-plans" | |
| if [ "${{ matrix.os }}" == "fedora" ] || [ "${{ matrix.os }}" == "c9s" ] || [ "${{ matrix.os }}" == "c10s" ] || [ "${{ matrix.os }}" == "c11s" ]; then | |
| api_key=${{ secrets.TF_PUBLIC_API_KEY }} | |
| branch="main" | |
| tf_scope="public" | |
| tmt_repo="https://github.com/sclorg/sclorg-testing-farm" | |
| if [ "${{ matrix.os }}" == "fedora" ]; then | |
| compose="Fedora-latest" | |
| context="Fedora" | |
| tmt_plan="/fedora" | |
| elif [ "${{ matrix.os }}" == "c9s" ]; then | |
| compose="CentOS-Stream-9" | |
| context="CentOS Stream 9" | |
| tmt_plan="/c9s" | |
| elif [ "${{ matrix.os }}" == "c10s" ]; then | |
| compose="CentOS-Stream-10" | |
| context="CentOS Stream 10" | |
| tmt_plan="/c10s" | |
| else | |
| # TODO - update compose and context for c11s when it will be available in Testing Farm | |
| compose="CentOS-Stream-10" | |
| context="CentOS Stream 11" | |
| tmt_plan="/c11s" | |
| fi | |
| else | |
| if [ "${{ matrix.os }}" == "rhel8" ]; then | |
| compose="RHEL-8.10.0-Nightly" | |
| context="RHEL8" | |
| tmt_plan="/rhel8-docker$" | |
| elif [ "${{ matrix.os }}" == "rhel9" ]; then | |
| compose="RHEL-9.6.0-Nightly" | |
| context="RHEL9" | |
| tmt_plan="/rhel9-docker$" | |
| elif [ "${{ matrix.os }}" == "rhel10" ]; then | |
| compose="RHEL-10-Nightly" | |
| context="RHEL10" | |
| tmt_plan="/rhel10-docker$" | |
| else | |
| # TODO - update compose and context for rhel11 when it will be available in Testing Farm | |
| compose="RHEL-10-Nightly" | |
| context="RHEL11" | |
| tmt_plan="/rhel11-docker$" | |
| fi | |
| fi | |
| echo "api_key=$api_key" >> "$GITHUB_OUTPUT" | |
| echo "branch=$branch" >> "$GITHUB_OUTPUT" | |
| echo "tf_scope=$tf_scope" >> "$GITHUB_OUTPUT" | |
| echo "tmt_repo=$tmt_repo" >> "$GITHUB_OUTPUT" | |
| echo "compose=$compose" >> "$GITHUB_OUTPUT" | |
| echo "context=$context" >> "$GITHUB_OUTPUT" | |
| echo "tmt_plan=$tmt_plan" >> "$GITHUB_OUTPUT" | |
| shell: bash | |
| # https://github.com/sclorg/testing-farm-as-github-action | |
| - name: Schedule tests on external Testing Farm by Testing-Farm-as-github-action | |
| id: github_action | |
| uses: sclorg/testing-farm-as-github-action@main | |
| with: | |
| api_key: ${{ steps.vars.outputs.api_key }} | |
| git_url: ${{ steps.vars.outputs.tmt_repo }} | |
| git_ref: ${{ steps.vars.outputs.branch }} | |
| tf_scope: ${{ steps.vars.outputs.tf_scope }} | |
| tmt_plan_regex: ${{ steps.vars.outputs.tmt_plan }} | |
| update_pull_request_status: true | |
| create_issue_comment: true | |
| pull_request_status_name: "${{ steps.vars.outputs.context }} - ${{ matrix.container-to-test }}" | |
| variables: "REPO_URL=${{ github.server_url }}/${{ github.repository }};REPO_NAME=${{ github.repository }};PR_NUMBER=${{ github.event.issue.number }};OS=${{ matrix.os }};TEST_NAME=test;TESTED_IMAGE=${{ matrix.container-to-test }}" | |
| compose: ${{ steps.vars.outputs.compose }} |