|  | 
|  | 1 | +name: TEST Xetabase and publish report workflow | 
|  | 2 | + | 
|  | 3 | +on: | 
|  | 4 | +  workflow_call: | 
|  | 5 | +    inputs: | 
|  | 6 | +      task: | 
|  | 7 | +        type: string | 
|  | 8 | +        required: true | 
|  | 9 | +      branch: | 
|  | 10 | +        type: string | 
|  | 11 | +        required: true | 
|  | 12 | +  workflow_dispatch: | 
|  | 13 | +    inputs: | 
|  | 14 | +      task: | 
|  | 15 | +        type: string | 
|  | 16 | +        description: 'Task ID to be tested.' | 
|  | 17 | +        required: true | 
|  | 18 | +      branch: | 
|  | 19 | +        type: string | 
|  | 20 | +        description: 'Branch of opencga-enterprise to be tested and built.' | 
|  | 21 | +        required: true | 
|  | 22 | +env: | 
|  | 23 | +  AZCOPY_SPA_CLIENT_SECRET: ${{ secrets.AZCOPY_SPA_CLIENT_SECRET }} | 
|  | 24 | +  AZCOPY_AUTO_LOGIN_TYPE: "SPN" | 
|  | 25 | +  AZCOPY_SPA_APPLICATION_ID: ${{ secrets.AZCOPY_SPA_APPLICATION_ID }} | 
|  | 26 | +  AZCOPY_TENANT_ID: ${{ secrets.AZCOPY_TENANT_ID }} | 
|  | 27 | + | 
|  | 28 | +jobs: | 
|  | 29 | +  test: | 
|  | 30 | +    name: Execute JUnit and Jacoco tests | 
|  | 31 | +    runs-on: ubuntu-22.04 | 
|  | 32 | +    steps: | 
|  | 33 | +      - name: Clone OpenCGA Enterprise branch '${{ github.event.inputs.branch }}' | 
|  | 34 | +        uses: actions/checkout@v4 | 
|  | 35 | +        with: | 
|  | 36 | +          repository: zetta-genomics/opencga-enterprise | 
|  | 37 | +          ref: ${{ github.event.inputs.branch }} | 
|  | 38 | +          token: ${{ secrets.ZETTA_REPO_ACCESS_TOKEN }} | 
|  | 39 | +          path: opencga-enterprise | 
|  | 40 | +          fetch-depth: "10" | 
|  | 41 | +      - id: get_opencga_branch | 
|  | 42 | +        name: Get OpenCGA branch from 'pom.xml' property | 
|  | 43 | +        run: | | 
|  | 44 | +          pwd | 
|  | 45 | +          chmod +x ./opencga-enterprise/.github/workflows/scripts/xetabase-branch.sh | 
|  | 46 | +          opencga_branch=$(./opencga-enterprise/.github/workflows/scripts/xetabase-branch.sh ${{ github.event.inputs.task }}) | 
|  | 47 | +          echo "opencga_branch=${opencga_branch}" >> $GITHUB_OUTPUT | 
|  | 48 | +      - uses: actions/checkout@v4 | 
|  | 49 | +        with: | 
|  | 50 | +          repository: opencb/opencga | 
|  | 51 | +          ref: ${{ steps.get_opencga_branch.outputs.opencga_branch }} | 
|  | 52 | +          path: opencga | 
|  | 53 | +          fetch-depth: '10' | 
|  | 54 | +      - name: Set up JDK 8 | 
|  | 55 | +        uses: actions/setup-java@v4 | 
|  | 56 | +        with: | 
|  | 57 | +          distribution: 'temurin' | 
|  | 58 | +          java-version: '8' | 
|  | 59 | +          cache: 'maven' | 
|  | 60 | +      - name: Install Samtools | 
|  | 61 | +        run: sudo apt-get install samtools python3-deeptools | 
|  | 62 | +      - name: Start MongoDB v6.0 | 
|  | 63 | +        uses: supercharge/[email protected] | 
|  | 64 | +        with: | 
|  | 65 | +          mongodb-version: 6.0 | 
|  | 66 | +          mongodb-replica-set: rs-test | 
|  | 67 | +      - name: K8s Tunnel MongoDB | 
|  | 68 | +        run: | | 
|  | 69 | +          wget https://dl.k8s.io/release/v1.28.2/bin/linux/amd64/kubectl | 
|  | 70 | +          chmod +x ./kubectl | 
|  | 71 | +          echo "${{ secrets.AZURE_KUBE_CONFIG }}" > admin.conf | 
|  | 72 | +          ./kubectl -n cellbase-db port-forward services/cellbase-rs0-svc 27018:27017 --kubeconfig ./admin.conf & | 
|  | 73 | +      - name: Install Azure AZCOPY | 
|  | 74 | +        uses: kheiakiyama/install-azcopy-action@v1 | 
|  | 75 | +        with: | 
|  | 76 | +          version: 'v10' | 
|  | 77 | +      - name: DockerHub login | 
|  | 78 | +        uses: docker/login-action@v3 | 
|  | 79 | +        with: | 
|  | 80 | +          username: ${{ secrets.DOCKER_HUB_USER }} | 
|  | 81 | +          password: ${{ secrets.DOCKER_HUB_PASSWORD }} | 
|  | 82 | +      - name: Run all OpenCB Junit tests, ie. java-common-libs, biodata, cellbase, opencga and opencga-enterprise | 
|  | 83 | +        run: | | 
|  | 84 | +          ln -s opencga opencga-enterprise/opencga-home | 
|  | 85 | +          cd opencga-enterprise | 
|  | 86 | +          ./build.sh -t -l runShortTests,runMediumTests,runLongTests -b -s -f -T ${{ github.event.inputs.task }} -c localhost:27018 -H hdp3.1 | 
|  | 87 | +      - name: Upload reports results to Github | 
|  | 88 | +        uses: actions/upload-artifact@v4 | 
|  | 89 | +        with: | 
|  | 90 | +          name: report-test | 
|  | 91 | +          path: /home/runner/work/testing-environment/testing-environment/opencga-enterprise/reports/test | 
|  | 92 | +      - name: Upload log | 
|  | 93 | +        uses: actions/upload-artifact@v4 | 
|  | 94 | +        with: | 
|  | 95 | +          name: build-log | 
|  | 96 | +          path: /home/runner/work/testing-environment/testing-environment/opencga-enterprise/build.log | 
|  | 97 | +      - name: Upload junit reports to a remote scp server | 
|  | 98 | +        uses: garygrossgarten/github-action-scp@release | 
|  | 99 | +        with: | 
|  | 100 | +          local: opencga-enterprise/reports/test | 
|  | 101 | +          remote: /var/www/html/reports/xetabase/${{ github.event.inputs.task }}/ | 
|  | 102 | +          host: ${{ secrets.SSH_TESTING_SERVER_HOST}} | 
|  | 103 | +          port: ${{ secrets.SSH_TESTING_SERVER_PORT}} | 
|  | 104 | +          username: ${{ secrets.SSH_TESTING_SERVER_USER }} | 
|  | 105 | +          password: ${{ secrets.SSH_TESTING_SERVER_PASSWORD }} | 
|  | 106 | +          concurrency: 2 | 
|  | 107 | + | 
|  | 108 | + | 
0 commit comments