Component Tests #115
This file contains 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: Component Tests | |
on: | |
push: | |
branches: | |
- master | |
- release | |
pull_request: | |
branches: | |
- master | |
- release | |
schedule: | |
- cron: "0 0 * * *" #end of every day | |
jobs: | |
lint: | |
strategy: | |
fail-fast: false #ensure both tests run even if one fails | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: '0' | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: 11 | |
- name: Cache Gradle packages | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('.gradle/*.gradle*', 'build.gradle') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
- name: Cache eslint | |
uses: actions/cache@v4 | |
with: | |
path: | | |
./.eslintcache | |
key: ${{ runner.os }}-eslint-${{ hashFiles('.eslintcache') }} | |
restore-keys: | | |
${{ runner.os }}-eslint- | |
- name: Cache stylelint | |
uses: actions/cache@v4 | |
with: | |
path: | | |
./.stylelintcache | |
key: ${{ runner.os }}-stylelint-${{ hashFiles('.stylelintcache') }} | |
restore-keys: | | |
${{ runner.os }}-stylelint- | |
- name: Run Backend Linting | |
run: ./gradlew lint --continue | |
- name: Install Frontend Dependencies | |
run: npm ci | |
- name: Run Lint Checks | |
run: npm run lint | |
component-testing: | |
strategy: | |
fail-fast: false #ensure both tests run even if one fails | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: 11 | |
- name: Cache Gradle packages | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
- name: Update Property File | |
run: mv src/test/resources/test.ci-${{ matrix.os }}.properties src/test/resources/test.properties | |
- name: Run Solr search service | |
if: matrix.os == 'ubuntu-latest' # Docker does not work well on Windows env | |
run: docker-compose run -d -p 8983:8983 solr | |
- name: Run Backend Tests | |
run: | | |
./gradlew createConfigs componentTests --continue | |
./gradlew jacocoReport | |
- name: Generate Types | |
run: ./gradlew generateTypes | |
- name: Install Frontend Dependencies | |
run: npm ci | |
- name: Run Frontend Tests | |
run: npm run coverage | |
- name: Upload to Codecov | |
if: matrix.os == 'ubuntu-latest' #only upload to codecov on ubuntu VM | |
uses: codecov/codecov-action@v3 |