mirror of
https://gitee.com/devlive-community/datacap.git
synced 2024-12-05 05:27:52 +08:00
133 lines
4.5 KiB
YAML
133 lines
4.5 KiB
YAML
name: Before checker with maven
|
|
|
|
on:
|
|
push:
|
|
branches: [ "*" ]
|
|
pull_request:
|
|
branches: [ "dev" ]
|
|
|
|
jobs:
|
|
before_checker_loading:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
- run: echo 'Before checker loading'
|
|
|
|
before_checker_ui:
|
|
runs-on: ubuntu-latest
|
|
needs:
|
|
- before_checker_loading
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
- name: Set Node.js 18.x
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: 18.x
|
|
- run: cd core/datacap-ui && npm install pnpm -g && pnpm install && pnpm run build
|
|
|
|
before_checker_style:
|
|
runs-on: ubuntu-latest
|
|
needs:
|
|
- before_checker_ui
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
- name: Maven Checker Style
|
|
uses: actions/setup-java@v3
|
|
with:
|
|
java-version: '11'
|
|
distribution: 'temurin'
|
|
- run: chmod 755 ./mvnw
|
|
- run: ./mvnw clean install checkstyle:checkstyle -Dspotbugs.skip -Dgpg.skip -Dskip.pnpm -DskipTests=true
|
|
|
|
before_checker_bugs:
|
|
runs-on: ubuntu-latest
|
|
needs:
|
|
- before_checker_ui
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
- name: Maven Checker Bugs
|
|
uses: actions/setup-java@v3
|
|
with:
|
|
java-version: '11'
|
|
distribution: 'temurin'
|
|
- name: Grant execute permission for mvnw
|
|
run: chmod +x mvnw
|
|
- name: Run SpotBugs skip server
|
|
env:
|
|
MAVEN_OPTS: -Xmx1024m
|
|
run: ./mvnw clean install spotbugs:spotbugs -pl '!core/datacap-server' -Dcheckstyle.skip -Dgpg.skip -Dskip.pnpm -DskipTests=true
|
|
- name: Run SpotBugs for server
|
|
run: ./mvnw clean install spotbugs:spotbugs -Dcheckstyle.skip -Dgpg.skip -Dskip.pnpm -DskipTests=true -f core/datacap-server/pom.xml
|
|
|
|
before_checker_test:
|
|
runs-on: ubuntu-latest
|
|
needs:
|
|
- before_checker_style
|
|
- before_checker_bugs
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Maven Checker Style
|
|
uses: actions/setup-java@v3
|
|
with:
|
|
java-version: '11'
|
|
distribution: 'temurin'
|
|
|
|
- run: chmod 755 ./mvnw
|
|
|
|
- name: Debug Environment Variables
|
|
env:
|
|
QINIU_ACCESS: ${{ secrets.QINIU_ACCESS }}
|
|
QINIU_SECRET: ${{ secrets.QINIU_SECRET }}
|
|
QINIU_BUCKET: ${{ secrets.QINIU_BUCKET }}
|
|
QINIU_ENDPOINT: ${{ secrets.QINIU_ENDPOINT }}
|
|
run: |
|
|
echo "QINIU_ENDPOINT is set: ${{ secrets.QINIU_ENDPOINT != '' }}"
|
|
echo "QINIU_ENDPOINT length: ${#QINIU_ENDPOINT}"
|
|
|
|
- name: Run Tests
|
|
if: ${{ env.QINIU_ENDPOINT != '' }}
|
|
env:
|
|
QINIU_ACCESS: ${{ secrets.QINIU_ACCESS }}
|
|
QINIU_SECRET: ${{ secrets.QINIU_SECRET }}
|
|
QINIU_BUCKET: ${{ secrets.QINIU_BUCKET }}
|
|
QINIU_ENDPOINT: ${{ secrets.QINIU_ENDPOINT }}
|
|
ALIOSS_ACCESS: ${{ secrets.ALIOSS_ACCESS }}
|
|
ALIOSS_SECRET: ${{ secrets.ALIOSS_SECRET }}
|
|
ALIOSS_BUCKET: ${{ secrets.ALIOSS_BUCKET }}
|
|
ALIOSS_ENDPOINT: ${{ secrets.ALIOSS_ENDPOINT }}
|
|
COS_ACCESS: ${{ secrets.COS_ACCESS }}
|
|
COS_SECRET: ${{ secrets.COS_SECRET }}
|
|
COS_BUCKET: ${{ secrets.COS_BUCKET }}
|
|
COS_ENDPOINT: ${{ secrets.COS_ENDPOINT }}
|
|
S3_ACCESS: ${{ secrets.S3_ACCESS }}
|
|
S3_SECRET: ${{ secrets.S3_SECRET }}
|
|
S3_BUCKET: ${{ secrets.S3_BUCKET }}
|
|
S3_ENDPOINT: ${{ secrets.S3_ENDPOINT }}
|
|
run: |
|
|
./mvnw clean test -Dspotbugs.skip -Dgpg.skip -Dcheckstyle.skip -Dskip.pnpm \
|
|
-Dqiniu.access="$QINIU_ACCESS" -Dqiniu.secret="$QINIU_SECRET" -Dqiniu.bucket="$QINIU_BUCKET" -Dqiniu.endpoint="$QINIU_ENDPOINT" \
|
|
-Dalioss.access="$ALIOSS_ACCESS" -Dalioss.secret="$ALIOSS_SECRET" -Dalioss.bucket="$ALIOSS_BUCKET" -Dalioss.endpoint="$ALIOSS_ENDPOINT" \
|
|
-Dcos.access="$COS_ACCESS" -Dcos.secret="$COS_SECRET" -Dcos.bucket="$COS_BUCKET" -Dcos.endpoint="$COS_ENDPOINT" \
|
|
-Ds3.access="$S3_ACCESS" -Ds3.secret="$S3_SECRET" -Ds3.bucket="$S3_BUCKET" -Ds3.endpoint="$S3_ENDPOINT"
|
|
|
|
before_checker_package:
|
|
runs-on: ubuntu-latest
|
|
needs:
|
|
- before_checker_test
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
- name: Maven Checker Package
|
|
uses: actions/setup-java@v3
|
|
with:
|
|
java-version: '11'
|
|
distribution: 'temurin'
|
|
- run: chmod 755 ./mvnw
|
|
- run: ./mvnw -T 1C clean install package -Dspotbugs.skip -Dgpg.skip -Dcheckstyle.skip -DskipTests=true
|