Update GitHub Actions workflow to use custom Docker action for JS tests #957
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build And Test | ||
| on: [pull_request] | ||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v1 | ||
| - name: Build | ||
| uses: ./docker/gh-build | ||
| env: | ||
| DBX_TEST_CLIENT_ID: ${{ secrets.DBX_TEST_CLIENT_ID }} | ||
| DBX_TEST_ACCESS_TOKEN: ${{ secrets.DBX_TEST_ACCESS_TOKEN }} | ||
| with: | ||
| args: ./gradlew clean build -x test -x jvmTest -x jsTest -x jsNodeTest -x jsBrowserTest --info --max-workers 1 --no-daemon | ||
| - name: JVM Tests | ||
| uses: ./docker/gh-build | ||
| env: | ||
| DBX_TEST_CLIENT_ID: ${{ secrets.DBX_TEST_CLIENT_ID }} | ||
| DBX_TEST_ACCESS_TOKEN: ${{ secrets.DBX_TEST_ACCESS_TOKEN }} | ||
| with: | ||
| args: ./gradlew test jvmTest --info --max-workers 1 --no-daemon | ||
| - name: Install Xvfb | ||
| run: sudo apt-get install -y xvfb dbus-x11 | ||
| - name: Run Xvfb | ||
| run: | | ||
| Xvfb :99 -ac -screen 0 1920x1080x24 & | ||
| sudo service dbus start | ||
| - name: Set virtual display | ||
| run: echo "DISPLAY=:99" >> $GITHUB_ENV | ||
| - name: JS (Browser/Node) Tests | ||
| uses: ./docker/gh-build | ||
| run: | ||
| ./gradlew jsBrowserTest jsNodeTest --info --max-workers 1 --no-daemon | ||
| # Upload HTML test reports | ||
| - name: Upload Test Reports | ||
| uses: actions/upload-artifact@v4 | ||
| if: always() # Always upload, even if tests fail | ||
| with: | ||
| name: test-reports | ||
| path: | | ||
| **/build/reports/tests/ | ||
| **/build/test-results/ | ||
| retention-days: 30 | ||
| # Publish test results summary | ||
| - name: Publish Test Results | ||
| uses: EnricoMi/publish-unit-test-result-action@v2 | ||
| if: always() | ||
| with: | ||
| junit_files: '**/build/test-results/**/TEST-*.xml' | ||
| check_name: 'Test Results' | ||
| comment_mode: always | ||