From 18c1d177e2039f2cc0c2b887705fcf4daebb1c27 Mon Sep 17 00:00:00 2001 From: Xiangkun Yin Date: Mon, 29 Apr 2024 16:11:26 +0800 Subject: [PATCH] optimize: update codeql and ci (#660) --- .github/workflows/CI.yml | 13 ++++++++++++- .github/workflows/codeql-analysis.yml | 25 ++++++++++++++++++------- 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index cd8be650c..11b306ca5 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -21,4 +21,15 @@ jobs: distribution: 'zulu' java-version: ${{ matrix.java }} - name: Test with Maven - run: mvn test -B --file pom.xml + run: | + directories=("at-sample" "saga-sample" "tcc-sample" "xa-sample") + for dir in "${directories[@]}"; do + for subdir in "$dir"/*; do + if [ -d "$subdir" ]; then + echo "Entering directory $subdir" + cd "$subdir" + mvn -B test + cd - > /dev/null + fi + done + done diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 3734fda46..d658f8eb5 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -38,11 +38,11 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v1 + uses: github/codeql-action/init@v2 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -50,10 +50,19 @@ jobs: # Prefix the list here with "+" to use these queries and those in the config file. # queries: ./path/to/local/query, your-org/your-repo/queries@main - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v1 + - name: Build + run: | + directories=("at-sample" "saga-sample" "tcc-sample" "xa-sample") + for dir in "${directories[@]}"; do + for subdir in "$dir"/*; do + if [ -d "$subdir" ]; then + echo "Entering directory $subdir" + cd "$subdir" + mvn -B package + cd - > /dev/null + fi + done + done # ℹī¸ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -67,4 +76,6 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 + uses: github/codeql-action/analyze@v2 + with: + category: "/language:${{matrix.language}}"