Update linters (major) #25792
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: Build ANET | |
on: | |
push: | |
branches: | |
- '**' | |
tags: | |
- '**' | |
pull_request: | |
branches: | |
- main | |
env: | |
NODE_OPTIONS: '--max-old-space-size=8192' | |
DB_DRIVER: postgresql | |
DB_VERSION: 15 | |
jobs: | |
build: | |
name: Build with Gradle | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: ./.github/actions/build-cache | |
- run: ./gradlew check -x test | |
- run: ./gradlew prettierCheck | |
- run: ./gradlew yarn_run_lint | |
- run: ./gradlew jar buildClient | |
test-init: | |
needs: build | |
name: Test ANET init | |
runs-on: ubuntu-latest | |
env: | |
ANET_ADMIN_ORG_NAME: "ACME Administrators Inc." | |
ANET_ADMIN_POS_NAME: "The ANET admin" | |
ANET_ADMIN_FULL_NAME: "DOE, John" | |
ANET_ADMIN_DOMAIN_USERNAME: "johndoe" | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: ./.github/actions/build-cache | |
- run: ./gradlew -PtestEnv dockerCreateDB dockerStartDB | |
- run: ./gradlew -PtestEnv dockerConfigureKeycloak dockerStartKeycloak | |
# This step should fail: | |
- name: Run ANET init on empty database | |
id: init-on-empty-db | |
run: ./gradlew -PtestEnv dbInit | |
env: | |
ANET_DB_MIGRATE: false | |
continue-on-error: true | |
- run: exit 1 | |
if: ${{ steps.init-on-empty-db.outcome != 'failure' }} | |
# This step should succeed: | |
- name: Run ANET init on clean database | |
id: init-on-clean-db | |
run: ./gradlew -PtestEnv dbInit | |
env: | |
SPRING_PROFILES_ACTIVE: prod | |
# This step should fail: | |
- name: Run ANET init on filled database | |
id: init-on-filled-db | |
run: ./gradlew -PtestEnv dbInit | |
continue-on-error: true | |
- run: exit 1 | |
if: ${{ steps.init-on-filled-db.outcome != 'failure' }} | |
test-server: | |
needs: build | |
name: Server tests; ${{ matrix.dictionary }} | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
dictionary: [anet-dictionary.yml, testDictionaries/no-custom-fields.yml] | |
env: | |
ANET_DICTIONARY_NAME: ${{ matrix.dictionary }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: ./.github/actions/build-cache | |
- run: | | |
rm -rf client/build/test-results | |
mkdir -p client/build/test-results | |
- run: ./gradlew -PtestEnv dockerCreateDB dockerStartDB | |
- run: ./gradlew -PtestEnv dockerConfigureKeycloak dockerStartKeycloak | |
- run: ./gradlew -PtestEnv dockerCreateFakeSmtpServer dockerStartFakeSmtpServer | |
- run: ./gradlew -PtestEnv test jacocoTestReport | |
- run: ./gradlew yarn_run_server-junit-merge | |
- name: Strip slashes from dictionary name | |
id: strip-slashes | |
run: echo "dictionary=${ANET_DICTIONARY_NAME//\//_}" >> $GITHUB_OUTPUT | |
if: always() | |
- name: Upload test results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: server-test-results for ${{ steps.strip-slashes.outputs.dictionary }} | |
path: client/build/test-results/server-test-results.xml | |
if: always() | |
test-client: | |
needs: build | |
name: Client tests; ${{ matrix.client-tests }}, ${{ matrix.dictionary }} | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
dictionary: [anet-dictionary.yml] | |
client-tests: [jest, wdio-junit, e2e-junit] | |
include: | |
- dictionary: testDictionaries/no-custom-fields.yml | |
client-tests: wdio-noCF-junit | |
env: | |
ANET_DICTIONARY_NAME: ${{ matrix.dictionary }} | |
CLIENT_TESTS: ${{ matrix.client-tests }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: ./.github/actions/build-cache | |
- run: | | |
rm -rf client/build/test-results | |
mkdir -p client/build/test-results | |
- run: ./gradlew -PtestEnv dockerCreateDB dockerStartDB | |
- run: ./gradlew -PtestEnv dockerConfigureKeycloak dockerStartKeycloak | |
- run: ./gradlew -PtestEnv dockerCreateFakeSmtpServer dockerStartFakeSmtpServer | |
- run: ./gradlew -PtestEnv checkConfig | |
- run: | | |
./gradlew -PtestEnv run & | |
sleep 15 | |
- uses: olegtarasov/[email protected] | |
id: tagName | |
- name: Set local identifier for BrowserStack | |
id: browserstack-local | |
run: echo "identifier=github-${GITHUB_RUN_ID}-${DB_DRIVER}-${CLIENT_TESTS}" >> $GITHUB_OUTPUT | |
- run: ./gradlew yarn_run_test-${CLIENT_TESTS} | |
env: | |
GIT_TAG_NAME: ${{ steps.tagName.outputs.tag }} | |
BROWSERSTACK_LOCAL_IDENTIFIER: ${{ steps.browserstack-local.outputs.identifier }} | |
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} | |
BROWSERSTACK_USER: ${{ secrets.BROWSERSTACK_USER }} | |
- name: Strip slashes from dictionary name | |
id: strip-slashes | |
run: echo "dictionary=${ANET_DICTIONARY_NAME//\//_}" >> $GITHUB_OUTPUT | |
if: always() | |
- name: Upload client log | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.client-tests }}-client-log for ${{ steps.strip-slashes.outputs.dictionary }} | |
path: logs/clientLog.log | |
if-no-files-found: ignore | |
if: always() | |
- name: Upload test results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.client-tests }}-test-results for ${{ steps.strip-slashes.outputs.dictionary }} | |
path: client/build/test-results/${{ matrix.client-tests }}-test-results.xml | |
if: always() | |
test-sim: | |
needs: build | |
name: Test simulator | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: ./.github/actions/build-cache | |
- run: ./gradlew dockerCreateDB dockerStartDB | |
- run: ./gradlew dockerConfigureKeycloak dockerStartKeycloak | |
- run: ./gradlew checkConfig | |
- run: | | |
./gradlew run & | |
sleep 15 | |
- run: ./gradlew yarn_run_sim | |
env: | |
TEST_RUN: true |