|
| 1 | +name: Publish pytest data to S3 |
| 2 | +on: |
| 3 | + workflow_call: |
| 4 | + inputs: |
| 5 | + environment: { type: string, required: true } |
| 6 | + workflow_dispatch: |
| 7 | + inputs: |
| 8 | + environment: { type: environment, required: true } |
| 9 | + run_id: { type: number, required: true } |
| 10 | +run-name: Publish ${{github.ref}} to arcticdb-pytest-data |
| 11 | +permissions: |
| 12 | + contents: read |
| 13 | +jobs: |
| 14 | + sync_pytest_xmls: |
| 15 | + runs-on: ubuntu-22.04 |
| 16 | + container: |
| 17 | + image: ubuntu:22.04 # Native runner doesn't allow setting up the ca softlinks required below |
| 18 | + steps: |
| 19 | + - name: Select Python |
| 20 | + |
| 21 | + with: |
| 22 | + python-version: "3.11" |
| 23 | + |
| 24 | + - name: Setup env vars |
| 25 | + run: | |
| 26 | + # We are using an absolute path here because for some reason the upload-artifact action |
| 27 | + # does not work correctly with a relative path. |
| 28 | + echo "ARTEFACT_PATH=/tmp/${{ github.run_id }}" >> $GITHUB_ENV |
| 29 | + # get the current date and time in UTC |
| 30 | + echo "GITHUB_RUN_STARTED_AT=$(date -u +%Y-%m-%dT%H:%M:%SZ)" >> $GITHUB_ENV |
| 31 | +
|
| 32 | + - name: Gather pytest xmls from run ${{ github.run_id }} |
| 33 | + id: gather-pytest-xmls |
| 34 | + uses: actions/download-artifact@v4 |
| 35 | + with: |
| 36 | + pattern: "pytest-*" |
| 37 | + run-id: ${{ github.run_id }} |
| 38 | + github-token: ${{github.token}} |
| 39 | + path: ${{ env.ARTEFACT_PATH }} |
| 40 | + |
| 41 | + - name: Checkout |
| 42 | + |
| 43 | + |
| 44 | + - name: Install requirements |
| 45 | + run: | |
| 46 | + apt update |
| 47 | + apt install -y git |
| 48 | + python3 -m pip install arcticdb[Testing] click |
| 49 | +
|
| 50 | + - name: Setup softlink for SSL |
| 51 | + shell: bash -el {0} |
| 52 | + run: | |
| 53 | + mkdir -p /etc/pki/tls |
| 54 | + ln -s /usr/lib/ssl/certs /etc/pki/tls/certs |
| 55 | + ln -s /etc/ssl/certs/ca-certificates.crt /etc/pki/tls/certs/ca-bundle.crt |
| 56 | +
|
| 57 | + - name: Set persistent storage variables |
| 58 | + uses: ./.github/actions/set_persistent_storage_env_vars |
| 59 | + with: |
| 60 | + bucket: "arcticdb-ci-pytest-results" |
| 61 | + aws_access_key: "${{ secrets.AWS_S3_ACCESS_KEY }}" |
| 62 | + aws_secret_key: "${{ secrets.AWS_S3_SECRET_KEY }}" |
| 63 | + |
| 64 | + - name: Process pytest xmls |
| 65 | + run: | |
| 66 | + ls -R ${{ env.ARTEFACT_PATH }} |
| 67 | + python3 build_tooling/process_pytest_artifacts.py --download-dir ${{ env.ARTEFACT_PATH }} --use-github-actions |
0 commit comments