Eliminate Docker dependency for running unit tests

This commit is contained in:
Oscar Mira 2023-03-21 11:35:06 +01:00
parent 62080cfe92
commit 776c42b614
5 changed files with 12 additions and 20 deletions

View file

@ -11,4 +11,3 @@
**/test/androidTestEspresso/res/values/arrays.xml
reproducible-builds/certs
reproducible-builds/outputs
reproducible-builds/test-reports

View file

@ -10,6 +10,9 @@ on:
- '.github/FUNDING.yml'
- '.github/ISSUE_TEMPLATE/**'
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
wrapper_validation:
name: Validate Gradle wrapper
@ -36,17 +39,19 @@ jobs:
sudo swapon /swapB
swapon --show
- name: Set up builder image
run: docker-compose build
working-directory: reproducible-builds
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 11
cache: gradle
- name: Run tests
run: docker-compose run test
working-directory: reproducible-builds
run: ./gradlew build --no-daemon
- name: Archive reports for failed tests
if: "failure()"
uses: actions/upload-artifact@v3
with:
name: test-reports
path: "reproducible-builds/test-reports"
path: '*/build/reports'

1
.gitignore vendored
View file

@ -11,4 +11,3 @@ signing.properties
test/androidTestEspresso/res/values/arrays.xml
/reproducible-builds/certs
/reproducible-builds/outputs
/reproducible-builds/test-reports

View file

@ -4,7 +4,7 @@ services:
image: reproducible-molly
build:
context: ..
command: :app:assembleRelease :app:bundleRelease
command: :app:assembleRelease :app:bundleRelease --no-daemon
volumes:
- ./certs:/molly/app/certs:ro
- ./outputs:/molly/app/build/outputs
@ -18,14 +18,3 @@ services:
- CI_KEYSTORE_PATH
- CI_KEYSTORE_PASSWORD
- CI_KEYSTORE_ALIAS
test:
image: reproducible-molly
build:
context: ..
command: build
volumes:
- ./test-reports:/molly/app/build/reports
environment:
- BUILD_SCAN=1
profiles:
- test