|
| 1 | +name: Run operator E2E tests |
| 2 | +on: |
| 3 | + workflow_call: |
| 4 | + inputs: |
| 5 | + core_root: |
| 6 | + description: 'The root path for uid2-core folder' |
| 7 | + type: string |
| 8 | + default: '../uid2-core' |
| 9 | + optout_root: |
| 10 | + description: 'The root path for uid2-optout folder' |
| 11 | + type: string |
| 12 | + default: '../uid2-optout' |
| 13 | + admin_root: |
| 14 | + description: 'The root path for uid2-admin folder' |
| 15 | + type: string |
| 16 | + default: '../uid2-admin' |
| 17 | + operator_root: |
| 18 | + description: 'The root path for uid2-operator folder' |
| 19 | + type: string |
| 20 | + default: '../uid2-operator' |
| 21 | + operator_image_version: |
| 22 | + description: 'The version of UID2 operator image' |
| 23 | + type: string |
| 24 | + default: 'latest' |
| 25 | + core_image_version: |
| 26 | + description: 'The version of UID2 core image' |
| 27 | + type: string |
| 28 | + default: 'latest' |
| 29 | + optout_image_version: |
| 30 | + description: 'The version of UID2 optout image' |
| 31 | + type: string |
| 32 | + default: 'latest' |
| 33 | + e2e_image_version: |
| 34 | + description: 'The version of E2E image' |
| 35 | + type: string |
| 36 | + default: 'latest' |
| 37 | + core_branch: |
| 38 | + description: 'The branch of UID2-core to test on' |
| 39 | + type: string |
| 40 | + default: 'main' |
| 41 | + optout_branch: |
| 42 | + description: 'The branch of UID2-optout to test on' |
| 43 | + type: string |
| 44 | + default: 'main' |
| 45 | + admin_branch: |
| 46 | + description: 'The branch of UID2-admin to test on' |
| 47 | + type: string |
| 48 | + default: 'main' |
| 49 | + operator_branch: |
| 50 | + description: 'The branch of UID2-operator to test on' |
| 51 | + type: string |
| 52 | + default: 'main' |
| 53 | + operator_type: |
| 54 | + description: 'The type of operator [either public or private]' |
| 55 | + type: string |
| 56 | + default: 'public' |
| 57 | + uid2_e2e_identity_scope: |
| 58 | + description: 'Environment variable to run the E2E test' |
| 59 | + required: false |
| 60 | + type: string |
| 61 | + default: 'UID2' |
| 62 | + uid2_e2e_pipeline_operator_type: |
| 63 | + description: 'Environment variable to run the E2E test' |
| 64 | + required: false |
| 65 | + type: string |
| 66 | + default: 'PUBLIC' |
| 67 | + uid2_e2e_pipeline_operator_url: |
| 68 | + description: 'Environment variable to run the E2E test' |
| 69 | + required: false |
| 70 | + type: string |
| 71 | + default: 'http://publicoperator:8080' |
| 72 | + uid2_e2e_pipeline_operator_cloud_provider: |
| 73 | + description: 'Environment variable to run the E2E test' |
| 74 | + required: false |
| 75 | + type: string |
| 76 | + default: 'PUBLIC' |
| 77 | + uid2_e2e_phone_support: |
| 78 | + description: 'Environment variable to run the E2E test' |
| 79 | + required: false |
| 80 | + type: string |
| 81 | + default: 'true' |
| 82 | + |
| 83 | +env: |
| 84 | + REGISTRY: ghcr.io |
| 85 | + |
| 86 | +jobs: |
| 87 | + e2e-test: |
| 88 | + name: E2E Test |
| 89 | + runs-on: ubuntu-latest |
| 90 | + permissions: |
| 91 | + contents: write |
| 92 | + packages: read |
| 93 | + id-token: write |
| 94 | + steps: |
| 95 | + - name: Log in to the Docker container registry |
| 96 | + uses: docker/login-action@v2 |
| 97 | + with: |
| 98 | + registry: ${{ env.REGISTRY }} |
| 99 | + username: ${{ github.actor }} |
| 100 | + password: ${{ secrets.GHCR_PAT }} |
| 101 | + |
| 102 | + - name: Checkout full history |
| 103 | + uses: actions/checkout@v3 |
| 104 | + |
| 105 | + - name: Checkout uid2-core repo |
| 106 | + uses: actions/checkout@v3 |
| 107 | + with: |
| 108 | + ref: ${{ inputs.core_branch }} |
| 109 | + repository: IABTechLab/uid2-core |
| 110 | + path: uid2-core |
| 111 | + |
| 112 | + - name: Checkout uid2-optout repo |
| 113 | + uses: actions/checkout@v3 |
| 114 | + with: |
| 115 | + ref: ${{ inputs.optout_branch }} |
| 116 | + repository: IABTechLab/uid2-optout |
| 117 | + path: uid2-optout |
| 118 | + |
| 119 | + - name: Checkout uid2-admin repo |
| 120 | + uses: actions/checkout@v3 |
| 121 | + with: |
| 122 | + ref: ${{ inputs.admin_branch }} |
| 123 | + repository: IABTechLab/uid2-admin |
| 124 | + path: uid2-admin |
| 125 | + |
| 126 | + - name: Checkout uid2-operator repo |
| 127 | + uses: actions/checkout@v3 |
| 128 | + with: |
| 129 | + ref: ${{ inputs.operator_branch }} |
| 130 | + repository: IABTechLab/uid2-operator |
| 131 | + path: uid2-operator |
| 132 | + |
| 133 | + - name: Checkout uid2-shared-actions repo |
| 134 | + uses: actions/checkout@v3 |
| 135 | + with: |
| 136 | + repository: IABTechLab/uid2-shared-actions |
| 137 | + path: uid2-shared-actions |
| 138 | + |
| 139 | + - name: Checkout uid2-e2e repo |
| 140 | + uses: actions/checkout@v3 |
| 141 | + with: |
| 142 | + repository: IABTechLab/uid2-e2e |
| 143 | + path: uid2-e2e |
| 144 | + |
| 145 | + - name: Bring up docker compose |
| 146 | + id: docker-compose |
| 147 | + env: |
| 148 | + CORE_ROOT: ${{ inputs.core_root }} |
| 149 | + OPTOUT_ROOT: ${{ inputs.optout_root }} |
| 150 | + ADMIN_ROOT: ${{ inputs.admin_root }} |
| 151 | + OPERATOR_ROOT: ${{ inputs.operator_root }} |
| 152 | + CORE_VERSION: ${{ inputs.core_image_version }} |
| 153 | + OPTOUT_VERSION: ${{ inputs.optout_image_version }} |
| 154 | + OPERATOR_VERSION: ${{ inputs.operator_image_version }} |
| 155 | + E2E_VERSION: ${{ inputs.e2e_image_version }} |
| 156 | + OPERATOR_TYPE: ${{ inputs.operator_type }} |
| 157 | + run: | |
| 158 | + cd e2e && bash ../uid2-shared-actions/scripts/prepare-resources-for-e2e-docker-compose.sh |
| 159 | +
|
| 160 | + - name: Run e2e tests |
| 161 | + id: e2e |
| 162 | + uses: IABTechLab/uid2-shared-actions/actions/run_e2e_tests@main |
| 163 | + with: |
| 164 | + e2e_image_version: ${{ inputs.e2e_image_version }} |
0 commit comments