|
| 1 | +# This job is to test different maven profiles in sdk branch again Pull Request raised |
| 2 | +# This workflow targets Java with Maven execution |
| 3 | + |
| 4 | +name: TestNG SDK Test workflow for Maven on comment RUN_TESTS |
| 5 | + |
| 6 | +on: |
| 7 | + issue_comment: |
| 8 | + branches: [ "master" ] |
| 9 | + types: [ created ] |
| 10 | + |
| 11 | +jobs: |
| 12 | + comment-run: |
| 13 | + if: contains(github.event.comment.body, 'RUN_TESTS') && github.event.issue.pull_request |
| 14 | + runs-on: ${{ matrix.os }} |
| 15 | + continue-on-error: true |
| 16 | + strategy: |
| 17 | + max-parallel: 1 |
| 18 | + matrix: |
| 19 | + java: [ '8', '11', '17' ] |
| 20 | + os: [ 'macos-latest', 'windows-latest', 'ubuntu-latest' ] |
| 21 | + name: TestNG Repo ${{ matrix.Java }} - ${{ matrix.os }} Sample |
| 22 | + env: |
| 23 | + BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }} |
| 24 | + BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} |
| 25 | + |
| 26 | + steps: |
| 27 | + - uses: actions/checkout@v3 |
| 28 | + - uses: actions/github-script@v6 |
| 29 | + id: check-membership |
| 30 | + with: |
| 31 | + script: | |
| 32 | + const creator = context.payload.sender.login |
| 33 | + const result = await github.rest.teams.getMembershipForUserInOrg({ |
| 34 | + org: context.repo.owner, |
| 35 | + team_slug: 'asi-devs', |
| 36 | + username: creator |
| 37 | + }) |
| 38 | + console.log(`The comment creator ${creator} membership - ${result}`) |
| 39 | + if (response.state === "active") { |
| 40 | + return "true" |
| 41 | + } |
| 42 | + core.setFailed('User is not part of the owner team!') |
| 43 | + - name: Set up Java |
| 44 | + uses: actions/setup-java@v3 |
| 45 | + with: |
| 46 | + distribution: 'temurin' |
| 47 | + java-version: ${{ matrix.java }} |
| 48 | + - name: Run mvn test |
| 49 | + run: | |
| 50 | + mvn compile |
| 51 | + mvn test |
| 52 | + - name: Run mvn profile sample-local-test |
| 53 | + run: | |
| 54 | + mvn compile |
| 55 | + mvn test -P sample-local-test |
| 56 | + - name: Run mvn profile sample-test |
| 57 | + run: | |
| 58 | + mvn compile |
| 59 | + mvn test -P sample-test |
0 commit comments