Update commonslang.yml #7
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 and Test | |
on: | |
push: | |
branches: | |
- github_action_java | |
pull_request: | |
branches: | |
- github_action_java | |
jobs: | |
build: | |
name: Build and Test | |
runs-on: ubuntu-latest | |
steps: | |
# Step 1: Check out the repository code | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
# Step 2: Set up Java environment | |
- name: Set up JDK | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' # Use Eclipse Temurin JDK | |
java-version: '17' # Update this version as per project requirements | |
# Step 3: Cache Maven dependencies | |
- name: Cache Maven dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-maven- | |
# Step 4: Run Maven build | |
- name: Build with Maven | |
run: | | |
cd sample_source_code/JAVA/commons-lang | |
mvn clean install --batch-mode | |
# Step 5: Download and un-tar the BrowserStack CQ Scanner | |
- name: Download and Unpack BrowserStack CQ Scanner | |
run: | | |
curl https://v1.embold.io/nfs/CLI/browserstack-codequality-scanner.tar.gz -o browserstack-codequality-scanner-archive.tar.gz | |
tar xvf browserstack-codequality-scanner-archive.tar.gz | |
# Step 7: Run the BrowserStack CQ Scanner | |
- name: Run Static Code Analysis | |
env: | |
EMBOLD_TOKEN: ${{ secrets.EMBOLD_TOKEN_DEMO_INST }} | |
run: | | |
./browserstack-codequality-scanner/bin/embold-scanner analyse \ | |
-u https://demo.embold.io \ | |
-t $EMBOLD_TOKEN \ | |
-r e602c21b7e4d91f90b2914504eaeb8ae \ | |
-c sample_source_code/JAVA/commons-lang/repository-configuration.json |