Skip to content

chore(deps): update dependency eslint-plugin-unused-imports to v3 - autoclosed #15068

chore(deps): update dependency eslint-plugin-unused-imports to v3 - autoclosed

chore(deps): update dependency eslint-plugin-unused-imports to v3 - autoclosed #15068

Workflow file for this run

name: openEQUELLA CI
on:
push:
branches:
- master
- develop
- release/**
- stable-*
- component/**
tags:
- "**"
pull_request:
branches:
- master
- develop
- release/**
- stable-*
- component/**
jobs:
build_and_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: NPM Cache
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
- name: SBT Cache
uses: actions/cache@v4
with:
path: ~/.sbt
key: ${{ runner.os }}-sbt-${{ hashFiles('**/build.sbt') }}
restore-keys: |
${{ runner.os }}-sbt-
- name: Ivy Cache
uses: actions/cache@v4
with:
path: ~/.ivy2/cache
key: ${{ runner.os }}-ivy-${{ hashFiles('**/build.sbt') }}
restore-keys: |
${{ runner.os }}-ivy-
- name: Setup node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
- name: Install node dependencies (oeq-rest-api)
working-directory: oeq-ts-rest-api
run: |
npm ci
- name: Build oEQ REST module (oeq-rest-api)
working-directory: oeq-ts-rest-api
run: |
npm run build
- name: Install node dependencies (core)
working-directory: react-front-end
run: |
npm ci
- name: Install node dependencies (IntegTester)
working-directory: autotest/IntegTester/front-end
run: |
npm ci
- name: Install node dependencies (root)
run: |
npm ci
- name: Run checks
run: |
npm run check
./sbt headerCheck
# oeq-ts-rest-api has its own ESLint checks seeing the ultimate plan
# is that it's moved to its own stand-alone repo. But so here we need
# to explicitly run them.
- name: Run checks (oeq-ts-rest-api)
working-directory: oeq-ts-rest-api
run: |
npm run lint
- name: Run unit tests (java/scala)
run: |
./sbt test
- name: Run unit tests (javascript)
working-directory: react-front-end
run: |
npm cit
- name: Run unit tests (javascript - legacy)
working-directory: Source/Plugins/Core/com.equella.core/test/javascript
run: |
npm cit
- name: Build primary artefacts
run: |
./sbt installerZip writeLanguagePack writeScriptingJavadoc
- name: Package artefacts
# We use --transform below to strip out the path for the files in the tar file
run: |
tar cvf artefacts.tar --transform='s/.\+\///' \
Installer/target/equella-installer*.zip \
Source/Server/equellaserver/target/tle-upgrade*.zip \
target/*.zip
- name: Save primary artefacts
uses: actions/upload-artifact@v3.1.3
with:
name: Artefacts
path: artefacts.tar
build_storybook:
runs-on: ubuntu-latest
steps:
# Using v1 (rather than v2) through-out this workflow due to issue:
# https://github.com/actions/checkout/issues/237
- uses: actions/checkout@v4
- name: NPM Cache
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-npm.storybook-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm.storybook-
- name: Setup node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: Install node dependencies (oeq-rest-api)
working-directory: oeq-ts-rest-api
run: |
npm ci
- name: Build oEQ REST module (oeq-rest-api)
working-directory: oeq-ts-rest-api
run: |
npm run build
- name: Install node dependencies (core)
working-directory: react-front-end
run: |
npm ci
- name: Generate Static Storybook instance
working-directory: react-front-end
run: |
npm run build-storybook
- name: Package Static Storybook instance
working-directory: react-front-end
run: |
tar cvf storybook.tar storybook-static
- name: Save Static Storybook instance
uses: actions/upload-artifact@v3.1.3
with:
name: Storybook
path: react-front-end/storybook.tar
functional_testing:
needs: build_and_check
runs-on: ubuntu-latest
strategy:
matrix:
newui: [true, false]
pgsql-image: [latest, 12]
exclude:
- newui: false
pgsql-image: latest
fail-fast: false
services:
postgres:
image: postgres:${{ matrix.pgsql-image }}
env:
POSTGRES_USER: equellatests
POSTGRES_PASSWORD: password
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432
env:
AUTOTEST_CONFIG: autotest/github-actions.conf
EQ_EXIFTOOL_PATH: /usr/bin/exiftool
OLD_TEST_NEWUI: ${{ matrix.newui }}
steps:
- name: Install OS dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
ffmpeg \
libimage-exiftool-perl
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
- uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: Download Artefacts
uses: actions/download-artifact@v3
with:
path: Artefacts
name: Artefacts
- name: Extract installer from build
env:
DOWNLOAD_DIR: Artefacts
INSTALLER_DIR: Installer/target
run: |
tar --directory $DOWNLOAD_DIR -xvf $DOWNLOAD_DIR/artefacts.tar
mkdir -p $INSTALLER_DIR
mv -v $DOWNLOAD_DIR/equella-installer*.zip $INSTALLER_DIR
- name: Setup for tests
run: |
./sbt "project autotest" \
installEquella startEquella configureInstall setupForTests
- name: Run Scalacheck tests
# We only need to run these once, so we focus on the New UI
if: matrix.newui
run: |
./sbt "project autotest" Tests/test Tests/Serial/test dumpCoverage
- name: Save Scalacheck results
if: matrix.newui && failure()
uses: actions/upload-artifact@v3.1.3
with:
name: ScalacheckReports
path: autotest/Tests/target/test-reports
- name: Run TestNG tests
run: |
./sbt "project autotest" OldTests/test dumpCoverage
- name: Save TestNG Reports
if: failure()
uses: actions/upload-artifact@v3.1.3
with:
name: TestNGReports-new-${{ matrix.newui }}
path: autotest/OldTests/target/testng
- name: Save oEQ Logs
if: failure()
uses: actions/upload-artifact@v3.1.3
with:
name: oEQLogs-new-${{ matrix.newui }}
path: autotest/equella-install/logs
- name: Save Screenshots
if: failure()
uses: actions/upload-artifact@v3.1.3
with:
name: Screenshots-new-${{ matrix.newui }}
path: autotest/Tests/target/test-reports/screenshots
- name: Generate coverage report
run: |
./sbt "project autotest" coverageReport
# To save significant time on file upload, we first tar up the directory
# as it contains > 10k files and the artefact upload was taking almost
# 1hr.
- name: Package Coverage Report
run: |
tar cvf coverage_report.tar autotest/target/coverage-report/
- name: Save Coverage Report
uses: actions/upload-artifact@v3.1.3
with:
name: CoverageReport-newui-${{ matrix.newui }}
path: coverage_report.tar
rest-module-testing:
needs: build_and_check
runs-on: ubuntu-latest
services:
postgres:
image: postgres:latest
env:
POSTGRES_USER: equellatests
POSTGRES_PASSWORD: password
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432
env:
AUTOTEST_CONFIG: autotest/github-actions.conf
steps:
- uses: actions/checkout@v4
- name: Install OS dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
ffmpeg \
libimage-exiftool-perl
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
- name: Setup node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: Download installer
uses: actions/download-artifact@v3
with:
path: Artefacts
name: Artefacts
- name: Extract installer from build
env:
DOWNLOAD_DIR: Artefacts
INSTALLER_DIR: Installer/target
run: |
tar --directory $DOWNLOAD_DIR -xvf $DOWNLOAD_DIR/artefacts.tar
mkdir -p $INSTALLER_DIR
mv -v $DOWNLOAD_DIR/equella-installer*.zip $INSTALLER_DIR
- name: Install openEquella
run: |
./sbt "project autotest" \
installEquella startEquella configureInstall setupForTests
- name: Run tests
working-directory: oeq-ts-rest-api
run: |
npm cit
- name: Stop oEQ
if: failure()
run: |
./sbt "project autotest" stopEquella
- name: Save oEQ logs for REST Module
if: failure()
uses: actions/upload-artifact@v3.1.3
with:
name: oEQ-logs-rest-module
path: autotest/equella-install/logs