⬆️ Bump axios from 1.7.2 to 1.7.9 in /spring-cloud-xuxiaowei-ui #828
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
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven | |
# This workflow uses actions that are not certified by GitHub. | |
# They are provided by a third-party and are governed by | |
# separate terms of service, privacy policy, and support | |
# documentation. | |
name: Java CI with Maven Spring Boot 2 | |
on: | |
push: | |
branches: [ "spring-boot-2" ] | |
pull_request: | |
branches: [ "spring-boot-2" ] | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
java-version: [ 8, 11, 17, 21 ] | |
os: [ ubuntu-latest ] | |
env: | |
XUXIAOWEI_DATABASE_USERNAME: root | |
XUXIAOWEI_DATABASE_PASSWORD: xuxiaowei.com.cn | |
XUXIAOWEI_DATABASE: spring_cloud_xuxiaowei | |
XUXIAOWEI_NACOS_MYSQL_USERNAME: root | |
XUXIAOWEI_NACOS_MYSQL_PASSWORD: xuxiaowei.com.cn | |
XUXIAOWEI_NACOS_MYSQL_DATABASE: spring_cloud_xuxiaowei_nacos | |
XUXIAOWEI_REDIS_PASSWORD: "" | |
VERSION: 0.0.2-SNAPSHOT | |
services: | |
mysql: | |
image: mysql:8.0.36 | |
env: | |
MYSQL_DATABASE: ${{ env.XUXIAOWEI_DATABASE }} | |
MYSQL_ROOT_PASSWORD: ${{ env.XUXIAOWEI_DATABASE_PASSWORD }} | |
redis: | |
image: redis:7.2.4 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up JDK ${{ matrix.java-version }} | |
uses: actions/setup-java@v4 | |
with: | |
java-version: ${{ matrix.java-version }} | |
distribution: 'temurin' | |
- name: Cache modules | |
uses: actions/cache@v4 | |
id: cache-modules | |
with: | |
path: | | |
~/.m2/repository | |
~/.npm | |
$GITHUB_WORKSPACE/spring-cloud-xuxiaowei-ui/node_modules/ | |
key: ${{ matrix.os }}-spring-boot-2-java-${{ matrix.java-version }}-${{ hashFiles('pom.xml', '**/pom.xml', '**/**/pom.xml', '**/package.json') }} | |
restore-keys: | | |
${{ matrix.os }}-spring-boot-2-java-${{ matrix.java-version }}- | |
- name: Wait for MySQL | |
run: | | |
sleep 10 | |
until docker exec $(docker ps -qf "ancestor=mysql:8.0.36") mysqladmin ping --silent; do | |
echo 'Waiting for MySQL to be available...' | |
sleep 10 | |
done | |
sleep 10 | |
- name: Set ENV | |
shell: sh | |
run: | | |
docker ps | |
XUXIAOWEI_DATABASE_HOST=`docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $(docker ps -qf 'ancestor=mysql:8.0.36')` | |
XUXIAOWEI_REDIS_HOST=`docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $(docker ps -qf 'ancestor=redis:7.2.4')` | |
echo "XUXIAOWEI_DATABASE_HOST=$XUXIAOWEI_DATABASE_HOST" | |
echo "XUXIAOWEI_DATABASE_HOST=$XUXIAOWEI_DATABASE_HOST" >> $GITHUB_ENV | |
echo "XUXIAOWEI_NACOS_MYSQL_HOST=$XUXIAOWEI_DATABASE_HOST" | |
echo "XUXIAOWEI_NACOS_MYSQL_HOST=$XUXIAOWEI_DATABASE_HOST" >> $GITHUB_ENV | |
echo "XUXIAOWEI_REDIS_HOST=$XUXIAOWEI_REDIS_HOST" | |
echo "XUXIAOWEI_REDIS_HOST=$XUXIAOWEI_REDIS_HOST" >> $GITHUB_ENV | |
echo "XUXIAOWEI_FILE_LOCAL_FILE_PREFIX=$GITHUB_WORKSPACE" | |
echo "XUXIAOWEI_FILE_LOCAL_FILE_PREFIX=$GITHUB_WORKSPACE" >> $GITHUB_ENV | |
echo "XUXIAOWEI_FILE_ADD_RESOURCE_LOCATIONS=$GITHUB_WORKSPACE" | |
echo "XUXIAOWEI_FILE_ADD_RESOURCE_LOCATIONS=$GITHUB_WORKSPACE" >> $GITHUB_ENV | |
echo ${{ env.XUXIAOWEI_DATABASE_HOST }} | |
echo ${{ env.XUXIAOWEI_REDIS_HOST }} | |
echo ${{ env.XUXIAOWEI_NACOS_MYSQL_HOST }} | |
echo ${{ env.XUXIAOWEI_FILE_LOCAL_FILE_PREFIX }} | |
echo ${{ env.XUXIAOWEI_FILE_ADD_RESOURCE_LOCATIONS }} | |
- name: Get ENV | |
shell: sh | |
run: | | |
echo ${{ env.XUXIAOWEI_DATABASE_HOST }} | |
echo ${{ env.XUXIAOWEI_REDIS_HOST }} | |
echo ${{ env.XUXIAOWEI_NACOS_MYSQL_HOST }} | |
echo ${{ env.XUXIAOWEI_FILE_LOCAL_FILE_PREFIX }} | |
echo ${{ env.XUXIAOWEI_FILE_ADD_RESOURCE_LOCATIONS }} | |
- name: Init MySQL | |
run: | | |
mysql --version | |
mysql -u ${XUXIAOWEI_DATABASE_USERNAME} -p${XUXIAOWEI_DATABASE_PASSWORD} --host=${XUXIAOWEI_DATABASE_HOST} ${XUXIAOWEI_DATABASE} < sql/1-nacos-mysql-schema.sql | |
mysql -u ${XUXIAOWEI_DATABASE_USERNAME} -p${XUXIAOWEI_DATABASE_PASSWORD} --host=${XUXIAOWEI_DATABASE_HOST} ${XUXIAOWEI_DATABASE} < sql/2-nacos-mysql-data.sql | |
mysql -u ${XUXIAOWEI_DATABASE_USERNAME} -p${XUXIAOWEI_DATABASE_PASSWORD} --host=${XUXIAOWEI_DATABASE_HOST} ${XUXIAOWEI_DATABASE} < sql/3-security-mysql-schema.sql | |
mysql -u ${XUXIAOWEI_DATABASE_USERNAME} -p${XUXIAOWEI_DATABASE_PASSWORD} --host=${XUXIAOWEI_DATABASE_HOST} ${XUXIAOWEI_DATABASE} < sql/4-security-mysql-data.sql | |
mysql -u ${XUXIAOWEI_DATABASE_USERNAME} -p${XUXIAOWEI_DATABASE_PASSWORD} --host=${XUXIAOWEI_DATABASE_HOST} ${XUXIAOWEI_DATABASE} < sql/5-oauth-2.1-mysql-schema.sql | |
mysql -u ${XUXIAOWEI_DATABASE_USERNAME} -p${XUXIAOWEI_DATABASE_PASSWORD} --host=${XUXIAOWEI_DATABASE_HOST} ${XUXIAOWEI_DATABASE} < sql/6-oauth-2.1-mysql-data.sql | |
mysql -u ${XUXIAOWEI_DATABASE_USERNAME} -p${XUXIAOWEI_DATABASE_PASSWORD} --host=${XUXIAOWEI_DATABASE_HOST} ${XUXIAOWEI_DATABASE} < sql/7-session-jdbc-mysql-schema.sql | |
- name: Java version | |
run: java -version | |
- name: Maven version | |
run: mvn -v | |
- name: Build JDK ${{ matrix.java-version }} | |
if: ${{ matrix.java-version != 21 }} | |
run: mvn clean package source:jar javadoc:jar -Pjavadoc -U -DskipTests=true | |
- name: Build JDK ${{ matrix.java-version }} | |
if: ${{ matrix.java-version == 21 }} | |
run: mvn clean package source:jar -U -DskipTests=true | |
- name: Run Nacos | |
run: | | |
nohup java -jar nacos/target/nacos-${{ env.VERSION }}.jar > nohup-nacos.out 2>&1 & | |
sleep 20s | |
cat nohup-nacos.out | |
curl "http://127.0.0.1:8848/nacos/v1/cs/configs?dataId=&group=&appName=&config_tags=&pageNo=1&pageSize=10&tenant=&search=blur" && echo | |
cat nohup-nacos.out | |
- name: Run Passport | |
run: | | |
nohup java -jar spring-cloud-xuxiaowei-passport/target/spring-cloud-xuxiaowei-passport-${{ env.VERSION }}.jar > nohup-passport.out 2>&1 & | |
sleep 20s | |
cat nohup-passport.out | |
- name: Run File | |
run: | | |
nohup java -jar spring-cloud-xuxiaowei-file/target/spring-cloud-xuxiaowei-file-${{ env.VERSION }}.jar > nohup-file.out 2>&1 & | |
sleep 20s | |
cat nohup-file.out | |
- name: Run Gateway | |
run: | | |
nohup java -jar spring-cloud-xuxiaowei-gateway/target/spring-cloud-xuxiaowei-gateway-${{ env.VERSION }}.jar > nohup-gateway.out 2>&1 & | |
sleep 20s | |
cat nohup-gateway.out | |
- name: Install Playwright dependencies | |
run: | | |
cd $GITHUB_WORKSPACE/spring-cloud-xuxiaowei-ui | |
npm install | |
npm run build | |
- name: Install Playwright Browsers | |
run: | | |
cd $GITHUB_WORKSPACE/spring-cloud-xuxiaowei-ui | |
npx playwright install --with-deps | |
- name: Test | |
run: mvn test -DskipTests=false -Pvitest-coverage | |
- name: Run Playwright tests | |
if: ${{ matrix.java-version == 8 }} | |
run: | | |
cd $GITHUB_WORKSPACE/spring-cloud-xuxiaowei-ui | |
npx playwright test | |
- name: Upload Playwright artifact | |
uses: actions/upload-artifact@v4 | |
if: ${{ !cancelled() && matrix.java-version == 8 }} | |
with: | |
name: playwright-report | |
path: spring-cloud-xuxiaowei-ui/playwright-report/ | |
retention-days: 30 | |
- name: JaCoCo Report | |
if: ${{ matrix.java-version == 8 }} | |
run: >- | |
mvn jacoco:report | |
-pl spring-cloud-xuxiaowei-file | |
-pl spring-cloud-xuxiaowei-gateway | |
-pl spring-cloud-xuxiaowei-passport | |
-pl spring-cloud-xuxiaowei-commons/spring-cloud-xuxiaowei-commons-aop | |
-pl spring-cloud-xuxiaowei-commons/spring-cloud-xuxiaowei-commons-core | |
-pl spring-cloud-xuxiaowei-commons/spring-cloud-xuxiaowei-commons-loadbalancer | |
-pl spring-cloud-xuxiaowei-commons/spring-cloud-xuxiaowei-commons-oauth2 | |
-pl spring-cloud-xuxiaowei-commons/spring-cloud-xuxiaowei-commons-utils | |
-pl spring-cloud-xuxiaowei-commons/spring-cloud-xuxiaowei-commons-validation | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v4 | |
if: ${{ matrix.java-version == 8 }} | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} |