<commit_before>name: Run api tests
env:
  # This is to make sure Maven don't timeout fetching dependencies. See: https://github.com/actions/virtual-environments/issues/1499
  MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3 -Dmaven.wagon.httpconnectionManager.ttlSeconds=125

on:
  pull_request: 
    types: [ opened, labeled, synchronize ]
concurrency:
    group: ${{ github.workflow}}-${{ github.ref }}
    cancel-in-progress: true
jobs:    
  api-test:
    env:
      CORE_IMAGE_NAME: "dhis2/core:local"
      TEST_IMAGE_NAME: "dhis2/tests:local"
      PR_NUMBER: ${{ github.event.number }}
      DOCKER_CHANNEL: "dhis2/core-pr"
    
    runs-on: ubuntu-latest
    if: "!contains(github.event.pull_request.labels.*.name, 'skip-api-tests')"
    steps:
      - uses: actions/checkout@v3
      - name: Set up JDK 11
        uses: actions/setup-java@v3
        with:
          java-version: 11
          distribution: temurin
          cache: maven
      - name: Build core image
        run: |
          bash ./dhis-2/build-dev.sh

      - name: Login to Docker Hub
        if: "contains(github.event.pull_request.labels.*.name, 'publish-docker-image')"
        uses: docker/login-action@v2
        with:
          username: ${{ secrets.DHIS2_BOT_DOCKER_HUB_USERNAME }}
          password: ${{ secrets.DHIS2_BOT_DOCKER_HUB_PASSWORD }}
      
      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v1
        
      - name: Publish docker image
        if: "contains(github.event.pull_request.labels.*.name, 'publish-docker-image')"
        run: |
          docker tag $CORE_IMAGE_NAME $DOCKER_CHANNEL:$PR_NUMBER
          docker push $DOCKER_CHANNEL:$PR_NUMBER

      - name: Build test image
        uses: docker/build-push-action@v3
        with:
          context: dhis-2/dhis-e2e-test
          push: false
          load: true # https://github.com/docker/build-push-action/blob/5e11b373bfed0d8024ef33d1586c675819690e95/docs/advanced/export-docker.md
          tags: ${{ env.TEST_IMAGE_NAME }}
          cache-from: type=gha
          cache-to: type=gha,mode=max
      - name: Run tests
        run: |
          cd dhis-2/dhis-e2e-test
          IMAGE_NAME=$CORE_IMAGE_NAME docker-compose up --remove-orphans -d
          IMAGE_NAME=$TEST_IMAGE_NAME docker-compose -f docker-compose.e2e.yml up --exit-code-from e2e-test

      - name: Upload logs
        if: failure()
        run: |
          cd dhis-2/dhis-e2e-test
          docker-compose logs web > ~/logs.txt

      - uses: actions/upload-artifact@v3
        if: failure()
        with:
          name: "tomcat_logs"
          path: '~/logs.txt'
<commit_msg>chore(deps): bump docker/setup-buildx-action from 1 to 2 (#10730)<commit_after>name: Run api tests
env:
  # This is to make sure Maven don't timeout fetching dependencies. See: https://github.com/actions/virtual-environments/issues/1499
  MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3 -Dmaven.wagon.httpconnectionManager.ttlSeconds=125

on:
  pull_request: 
    types: [ opened, labeled, synchronize ]
concurrency:
    group: ${{ github.workflow}}-${{ github.ref }}
    cancel-in-progress: true
jobs:    
  api-test:
    env:
      CORE_IMAGE_NAME: "dhis2/core:local"
      TEST_IMAGE_NAME: "dhis2/tests:local"
      PR_NUMBER: ${{ github.event.number }}
      DOCKER_CHANNEL: "dhis2/core-pr"
    
    runs-on: ubuntu-latest
    if: "!contains(github.event.pull_request.labels.*.name, 'skip-api-tests')"
    steps:
      - uses: actions/checkout@v3
      - name: Set up JDK 11
        uses: actions/setup-java@v3
        with:
          java-version: 11
          distribution: temurin
          cache: maven
      - name: Build core image
        run: |
          bash ./dhis-2/build-dev.sh

      - name: Login to Docker Hub
        if: "contains(github.event.pull_request.labels.*.name, 'publish-docker-image')"
        uses: docker/login-action@v2
        with:
          username: ${{ secrets.DHIS2_BOT_DOCKER_HUB_USERNAME }}
          password: ${{ secrets.DHIS2_BOT_DOCKER_HUB_PASSWORD }}
      
      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v2
        
      - name: Publish docker image
        if: "contains(github.event.pull_request.labels.*.name, 'publish-docker-image')"
        run: |
          docker tag $CORE_IMAGE_NAME $DOCKER_CHANNEL:$PR_NUMBER
          docker push $DOCKER_CHANNEL:$PR_NUMBER

      - name: Build test image
        uses: docker/build-push-action@v3
        with:
          context: dhis-2/dhis-e2e-test
          push: false
          load: true # https://github.com/docker/build-push-action/blob/5e11b373bfed0d8024ef33d1586c675819690e95/docs/advanced/export-docker.md
          tags: ${{ env.TEST_IMAGE_NAME }}
          cache-from: type=gha
          cache-to: type=gha,mode=max
      - name: Run tests
        run: |
          cd dhis-2/dhis-e2e-test
          IMAGE_NAME=$CORE_IMAGE_NAME docker-compose up --remove-orphans -d
          IMAGE_NAME=$TEST_IMAGE_NAME docker-compose -f docker-compose.e2e.yml up --exit-code-from e2e-test

      - name: Upload logs
        if: failure()
        run: |
          cd dhis-2/dhis-e2e-test
          docker-compose logs web > ~/logs.txt

      - uses: actions/upload-artifact@v3
        if: failure()
        with:
          name: "tomcat_logs"
          path: '~/logs.txt'

{'fraction_non_alphanumeric': 0.11723265895953758, 'fraction_numerical': 0.022940751445086706, 'mean_word_length': 2.297796307325789, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2629347', 'n_tokens_mistral': 2004, 'n_tokens_neox': 1853, 'n_words': 349}