|
20 | 20 | type: number
|
21 | 21 | default: 170000
|
22 | 22 |
|
| 23 | +env: |
| 24 | + TEST_DATA_REVISION: 0.2.1 |
| 25 | + |
23 | 26 | jobs:
|
24 | 27 | setup:
|
25 | 28 | runs-on: ubuntu-latest
|
@@ -58,53 +61,95 @@ jobs:
|
58 | 61 | TEST_ARRAY+="]"
|
59 | 62 | echo "tests=$TEST_ARRAY" >> $GITHUB_OUTPUT
|
60 | 63 |
|
61 |
| - run_tests: |
62 |
| - needs: setup |
63 |
| - continue-on-error: true |
| 64 | + prepare_test_data: |
64 | 65 | strategy:
|
65 | 66 | matrix:
|
66 | 67 | os: [ ubuntu-latest, windows-latest ]
|
67 |
| - test: ${{ fromJSON(needs.setup.outputs.matrix-tests) }} |
68 |
| - chunk: ${{ fromJSON(needs.setup.outputs.matrix-chunks) }} |
69 |
| - |
70 |
| - name: Run ${{ matrix.test }}[${{ matrix.chunk }}] on ${{ matrix.os }} |
71 | 68 |
|
72 | 69 | runs-on: ${{ matrix.os }}
|
73 | 70 |
|
74 | 71 | steps:
|
75 | 72 | - uses: actions/checkout@v3
|
76 | 73 |
|
| 74 | + - name: Prepare test data (cache) |
| 75 | + id: test-data-cache |
| 76 | + uses: actions/cache@v3 |
| 77 | + env: |
| 78 | + cache-name: cache-test-data |
| 79 | + with: |
| 80 | + key: test-data-${{ env.TEST_DATA_REVISION }}-${{ matrix.os }} |
| 81 | + path: ksmt-test/testData/testData.zip |
| 82 | + |
77 | 83 | - name: Set up JDK 1.8
|
| 84 | + if: steps.test-data-cache.outputs.cache-hit != 'true' |
78 | 85 | uses: actions/setup-java@v3
|
79 | 86 | with:
|
80 | 87 | java-version: 8
|
81 | 88 | distribution: 'zulu'
|
82 | 89 | cache: gradle
|
83 | 90 |
|
84 |
| - - name: Build project |
| 91 | + - name: Prepare test data (download) |
| 92 | + if: steps.test-data-cache.outputs.cache-hit != 'true' |
85 | 93 | uses: gradle/gradle-build-action@v2
|
86 | 94 | with:
|
87 | 95 | arguments: |
|
88 |
| - build |
| 96 | + :ksmt-test:downloadPreparedSmtLibBenchmarkTestData |
89 | 97 | --no-daemon
|
| 98 | + -PtestDataRevision=${{ env.TEST_DATA_REVISION }} |
| 99 | +
|
| 100 | + run_tests: |
| 101 | + needs: [setup, prepare_test_data] |
| 102 | + continue-on-error: true |
| 103 | + strategy: |
| 104 | + matrix: |
| 105 | + os: [ ubuntu-latest, windows-latest ] |
| 106 | + test: ${{ fromJSON(needs.setup.outputs.matrix-tests) }} |
| 107 | + chunk: ${{ fromJSON(needs.setup.outputs.matrix-chunks) }} |
| 108 | + |
| 109 | + name: Run ${{ matrix.test }}[${{ matrix.chunk }}] on ${{ matrix.os }} |
| 110 | + |
| 111 | + runs-on: ${{ matrix.os }} |
| 112 | + |
| 113 | + steps: |
| 114 | + - uses: actions/checkout@v3 |
90 | 115 |
|
91 | 116 | - name: Prepare test data (cache)
|
92 | 117 | id: test-data-cache
|
93 | 118 | uses: actions/cache@v3
|
94 | 119 | env:
|
95 | 120 | cache-name: cache-test-data
|
96 | 121 | with:
|
97 |
| - key: test-data-0.2.1-${{ matrix.os }} |
98 |
| - path: ksmt-test/testData |
| 122 | + key: test-data-${{ env.TEST_DATA_REVISION }}-${{ matrix.os }} |
| 123 | + path: ksmt-test/testData/testData.zip |
99 | 124 |
|
100 |
| - - name: Prepare test data (download) |
| 125 | + - name: Check test data downloaded |
101 | 126 | if: steps.test-data-cache.outputs.cache-hit != 'true'
|
| 127 | + run: | |
| 128 | + echo "Test data is not available" |
| 129 | + exit 1 |
| 130 | +
|
| 131 | + - name: Set up JDK 1.8 |
| 132 | + uses: actions/setup-java@v3 |
| 133 | + with: |
| 134 | + java-version: 8 |
| 135 | + distribution: 'zulu' |
| 136 | + cache: gradle |
| 137 | + |
| 138 | + # Since ksmt-test/testData/testData.zip exists task will not download it again |
| 139 | + - name: Prepare test data (unpack) |
102 | 140 | uses: gradle/gradle-build-action@v2
|
103 | 141 | with:
|
104 | 142 | arguments: |
|
105 | 143 | :ksmt-test:downloadPreparedSmtLibBenchmarkTestData
|
106 | 144 | --no-daemon
|
107 |
| - -PtestDataRevision=0.2.1 |
| 145 | + -PtestDataRevision=${{ env.TEST_DATA_REVISION }} |
| 146 | +
|
| 147 | + - name: Build project |
| 148 | + uses: gradle/gradle-build-action@v2 |
| 149 | + with: |
| 150 | + arguments: | |
| 151 | + build |
| 152 | + --no-daemon |
108 | 153 |
|
109 | 154 | - name: Run ${{ matrix.test }}
|
110 | 155 | uses: gradle/gradle-build-action@v2
|
|
0 commit comments