|
| 1 | +# |
| 2 | +# DO NOT EDIT THIS FILE: it is generated from test-transform.template, Edit there and run make to change these files |
| 3 | +# |
| 4 | +name: Test - transforms/universal/hf_dataset_explorer |
| 5 | + |
| 6 | +on: |
| 7 | + workflow_dispatch: |
| 8 | + push: |
| 9 | + branches: |
| 10 | + - "dev" |
| 11 | + - "releases/**" |
| 12 | + tags: |
| 13 | + - "*" |
| 14 | + paths: |
| 15 | + - ".make.*" |
| 16 | + - "transforms/.make.transforms" |
| 17 | + - "transforms/universal/hf_dataset_explorer/**" |
| 18 | + - "data-processing-lib/**" |
| 19 | + - "!transforms/universal/hf_dataset_explorer/**/kfp_ray/**" # This is/will be tested in separate workflow |
| 20 | + - "!data-processing-lib/**/test/**" |
| 21 | + - "!data-processing-lib/**/test-data/**" |
| 22 | + - "!**.md" |
| 23 | + - "!**/doc/**" |
| 24 | + - "!**/images/**" |
| 25 | + - "!**.gitignore" |
| 26 | + pull_request: |
| 27 | + branches: |
| 28 | + - "dev" |
| 29 | + - "releases/**" |
| 30 | + paths: |
| 31 | + - ".make.*" |
| 32 | + - "transforms/.make.transforms" |
| 33 | + - "transforms/universal/hf_dataset_explorer/**" |
| 34 | + - "data-processing-lib/**" |
| 35 | + - "!transforms/universal/hf_dataset_explorer/**/kfp_ray/**" # This is/will be tested in separate workflow |
| 36 | + - "!data-processing-lib/**/test/**" |
| 37 | + - "!data-processing-lib/**/test-data/**" |
| 38 | + - "!**.md" |
| 39 | + - "!**/doc/**" |
| 40 | + - "!**/images/**" |
| 41 | + - "!**.gitignore" |
| 42 | + |
| 43 | +# Taken from https://stackoverflow.com/questions/66335225/how-to-cancel-previous-runs-in-the-pr-when-you-push-new-commitsupdate-the-curre |
| 44 | +concurrency: |
| 45 | + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} |
| 46 | + cancel-in-progress: true |
| 47 | + |
| 48 | +jobs: |
| 49 | + check_if_push_image: |
| 50 | + # check whether the Docker images should be pushed to the remote repository |
| 51 | + # The images are pushed if it is a merge to dev branch or a new tag is created. |
| 52 | + # The latter being part of the release process. |
| 53 | + # The images tag is derived from the value of the DOCKER_IMAGE_VERSION variable set in the .make.versions file. |
| 54 | + runs-on: ubuntu-22.04 |
| 55 | + outputs: |
| 56 | + publish_images: ${{ steps.version.outputs.publish_images }} |
| 57 | + steps: |
| 58 | + - id: version |
| 59 | + run: | |
| 60 | + publish_images='false' |
| 61 | + if [[ ${GITHUB_REF} == refs/heads/dev && ${GITHUB_EVENT_NAME} != 'pull_request' && ${GITHUB_REPOSITORY} == IBM/data-prep-kit ]] ; |
| 62 | + then |
| 63 | + publish_images='true' |
| 64 | + fi |
| 65 | + if [[ ${GITHUB_REF} == refs/tags/* && ${GITHUB_REPOSITORY} == IBM/data-prep-kit ]] ; |
| 66 | + then |
| 67 | + publish_images='true' |
| 68 | + fi |
| 69 | + echo "publish_images=$publish_images" >> "$GITHUB_OUTPUT" |
| 70 | + test-src: |
| 71 | + runs-on: ubuntu-22.04 |
| 72 | + steps: |
| 73 | + - name: Checkout |
| 74 | + uses: actions/checkout@v4 |
| 75 | + - name: Free up space in github runner |
| 76 | + # Free space as indicated here : https://github.com/actions/runner-images/issues/2840#issuecomment-790492173 |
| 77 | + run: | |
| 78 | + df -h |
| 79 | + sudo rm -rf "/usr/local/share/boost" |
| 80 | + sudo rm -rf "$AGENT_TOOLSDIRECTORY" |
| 81 | + sudo rm -rf /usr/share/dotnet /opt/ghc /usr/local/lib/android /usr/local/share/powershell /usr/share/swift /usr/local/.ghcup |
| 82 | + sudo docker rmi $(docker image ls -aq) >/dev/null 2>&1 || true |
| 83 | + df -h |
| 84 | + - name: Test transform source in transforms/universal/hf_dataset_explorer |
| 85 | + run: | |
| 86 | + if [ -e "transforms/universal/hf_dataset_explorer/Makefile" ]; then |
| 87 | + make -C transforms/universal/hf_dataset_explorer DOCKER=docker test-src |
| 88 | + else |
| 89 | + echo "transforms/universal/hf_dataset_explorer/Makefile not found - source testing disabled for this transform." |
| 90 | + fi |
| 91 | + test-image: |
| 92 | + needs: [check_if_push_image] |
| 93 | + runs-on: ubuntu-22.04 |
| 94 | + timeout-minutes: 120 |
| 95 | + env: |
| 96 | + DOCKER_REGISTRY_USER: ${{ secrets.DOCKER_REGISTRY_USER }} |
| 97 | + DOCKER_REGISTRY_KEY: ${{ secrets.DOCKER_REGISTRY_KEY }} |
| 98 | + steps: |
| 99 | + - name: Checkout |
| 100 | + uses: actions/checkout@v4 |
| 101 | + - name: Free up space in github runner |
| 102 | + # Free space as indicated here : https://github.com/actions/runner-images/issues/2840#issuecomment-790492173 |
| 103 | + run: | |
| 104 | + df -h |
| 105 | + sudo rm -rf /opt/ghc |
| 106 | + sudo rm -rf "/usr/local/share/boost" |
| 107 | + sudo rm -rf "$AGENT_TOOLSDIRECTORY" |
| 108 | + sudo rm -rf /usr/share/dotnet /opt/ghc /usr/local/lib/android /usr/local/share/powershell /usr/share/swift /usr/lib/jvm /usr/local/.ghcup |
| 109 | + sudo docker rmi $(docker image ls -aq) >/dev/null 2>&1 || true |
| 110 | + df -h |
| 111 | + - name: Test transform image in transforms/universal/hf_dataset_explorer |
| 112 | + run: | |
| 113 | + if [ -e "transforms/universal/hf_dataset_explorer/Makefile" ]; then |
| 114 | + if [ -d "transforms/universal/hf_dataset_explorer/spark" ]; then |
| 115 | + make -C data-processing-lib/spark DOCKER=docker image |
| 116 | + fi |
| 117 | + make -C transforms/universal/hf_dataset_explorer DOCKER=docker test-image |
| 118 | + else |
| 119 | + echo "transforms/universal/hf_dataset_explorer/Makefile not found - testing disabled for this transform." |
| 120 | + fi |
| 121 | + - name: Print space |
| 122 | + # Free space as indicated here : https://github.com/actions/runner-images/issues/2840#issuecomment-790492173 |
| 123 | + run: | |
| 124 | + df -h |
| 125 | + docker images |
| 126 | + - name: Publish images |
| 127 | + if: needs.check_if_push_image.outputs.publish_images == 'true' |
| 128 | + run: | |
| 129 | + if [ -e "transforms/universal/hf_dataset_explorer/Makefile" ]; then |
| 130 | + make -C transforms/universal/hf_dataset_explorer publish |
| 131 | + else |
| 132 | + echo "transforms/universal/hf_dataset_explorer/Makefile not found - publishing disabled for this transform." |
| 133 | + fi |
0 commit comments