-
Notifications
You must be signed in to change notification settings - Fork 150
92 lines (82 loc) · 3.9 KB
/
GHA-Scala-Functional-Tests.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: Scala Functional Tests
on:
workflow_dispatch:
inputs:
agent-ref:
description: 'The ref (branch, SHA, tag?) to run the tests on'
required: false
default: 'main'
type: string
workflow_call:
inputs:
agent-ref:
description: 'The ref (branch, SHA, tag?) to run the tests on'
required: false
default: 'main'
type: string
jobs:
scala-functional-tests:
name: Java ${{ matrix.java-version }}
timeout-minutes: 120
runs-on: ubuntu-20.04
strategy:
##max-parallel: 1 ## used to force sequential
fail-fast: false
matrix:
java-version: [8, 11]
steps:
- name: Checkout Java agent
uses: actions/checkout@v3
with:
ref: ${{ inputs.agent-ref || github.ref || 'main' }}
- name: Configure AWS Credentials
if: ${{ env.AWS_KEY != '' }}
uses: aws-actions/configure-aws-credentials@v1-node16
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-2
- name: Setup environment
uses: ./.github/actions/setup-environment
- name: Build newrelicJar
run: ./gradlew $GRADLE_OPTIONS clean jar
- name: Run functional tests against version defined in ${{ matrix.java-version }} (attempt 1)
id: run_tests_1
continue-on-error: true
timeout-minutes: 25
run: |
# Removed ":newrelic-cats-effect3-api:test" temporarily
./gradlew $GRADLE_OPTIONS :newrelic-scala3-api:test :newrelic-scala-api:test :newrelic-scala-cats-api:test :newrelic-scala-zio-api:test :newrelic-scala-zio2-api:test :newrelic-scala-monix-api:test -PincludeScala -Ptest${{ matrix.java-version }} --continue
- name: Run functional tests against version defined in ${{ matrix.java-version }} (attempt 2)
id: run_tests_2
continue-on-error: true
if: steps.run_tests_1.outcome == 'failure'
timeout-minutes: 25
run: |
# Removed ":newrelic-cats-effect3-api:test" temporarily
./gradlew $GRADLE_OPTIONS :newrelic-scala3-api:test :newrelic-scala-api:test :newrelic-scala-cats-api:test :newrelic-scala-zio-api:test :newrelic-scala-zio2-api:test :newrelic-scala-monix-api:test -PincludeScala -Ptest${{ matrix.java-version }} --continue
- name: Run functional tests against version defined in ${{ matrix.java-version }} (attempt 3)
if: steps.run_tests_2.outcome == 'failure'
timeout-minutes: 25
run: |
# Removed ":newrelic-cats-effect3-api:test" temporarily
./gradlew $GRADLE_OPTIONS :newrelic-scala3-api:test :newrelic-scala-api:test :newrelic-scala-cats-api:test :newrelic-scala-zio-api:test :newrelic-scala-zio2-api:test :newrelic-scala-monix-api:test -PincludeScala -Ptest${{ matrix.java-version }} --continue
- name: Capture Jacoco reports
if: matrix.java-version == '11'
uses: actions/upload-artifact@v3
with:
name: jacoco-reports-java-${{ matrix.java-version }}
path: |
**/build/reports/jacoco/**
# Capture HTML build result in artifacts
- name: Capture build reports
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: functional-tests-results-java-${{ matrix.java-version }}
# The regex for the path below will capture functional test HTML reports generated by gradle for all
# related modules: (functional_test, newrelic-scala-api, newrelic-scala-cats-api, :newrelic-cats-effect3-api, newrelic-scala-zio-api, newrelic-scala-zio2-api).
# However, it's critical that the previous build step does a ./gradlew clean or the regex will capture test reports
# that were leftover in unrelated modules for unit and instrumentation tests.
path: |
**/build/reports/tests/*