chore(award-service): Try out CodeQL to enforce basic architecture constraints #38
Workflow file for this run
This file contains hidden or 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: Sticker Award Service | |
| on: | |
| push: | |
| branches: ["main"] | |
| paths: | |
| - "sticker-award/**" | |
| pull_request: | |
| branches: ["main"] | |
| paths: | |
| - "sticker-award/**" | |
| workflow_dispatch: | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1 | |
| with: | |
| java-version: '21' | |
| distribution: 'temurin' | |
| cache: maven | |
| - name: Build with Maven | |
| run: | | |
| cd sticker-award | |
| ./mvnw clean package -DskipTests | |
| - name: Run Unit Tests | |
| run: | | |
| cd sticker-award | |
| ./mvnw test | |
| - name: Run Integration Tests | |
| run: | | |
| cd sticker-award | |
| ./mvnw verify -Dskip.unit.tests=true -DskipITs=false | |
| - name: Install CodeQL CLI | |
| run: | | |
| # Download and install CodeQL CLI | |
| wget -q https://github.com/github/codeql-cli-binaries/releases/latest/download/codeql-linux64.zip | |
| unzip -q codeql-linux64.zip | |
| sudo mv codeql /usr/local/bin/ | |
| codeql version --format=text | |
| - name: Create CodeQL Database | |
| run: | | |
| cd sticker-award | |
| codeql database create cql-db --language=java --source-root=. | |
| - name: Validate Architecture Rules | |
| run: | | |
| cd sticker-award | |
| ./scripts/validate-architecture.sh |