Executing various SCAs on UK-Export-Finance/exip ποΈ #6419
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
# EXIP Git Hub Actions | |
##################################### | |
# This GHA performs SCA amongst following remits: | |
# 1. Code quality | |
# 2. Code coverage | |
# 3. Vulnerabilities | |
# 4. Licensing | |
name: Source Code Analysis | |
run-name: Executing various SCAs on ${{ github.repository }} ποΈ | |
on: | |
pull_request: | |
branches: [main, main-*] | |
env: | |
environment: 'qa' | |
timezone: ${{ vars.TIMEZONE }} | |
jobs: | |
# 1. Setup test infrastructure | |
setup: | |
name: Infrastructure setup π§ | |
runs-on: ubuntu-latest | |
outputs: | |
environment: ${{ env.environment }} | |
timezone: ${{ env.timezone }} | |
steps: | |
- name: Environment π§ͺ | |
run: echo "Environment set to ${{ env.environment }}" | |
- name: Timezone π | |
run: echo "Timezone set to ${{ env.timezone }}" | |
# 2. Code quality - SCA | |
codacy: | |
name: Codacy π | |
needs: setup | |
environment: | |
name: ${{ needs.setup.outputs.environment }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Repository | |
uses: actions/checkout@v4 | |
- name: Codacy | |
uses: codacy/codacy-analysis-cli-action@master | |
with: | |
verbose: true | |
# 3. Code quality - Spell check | |
spell: | |
name: Spelling π | |
needs: setup | |
environment: | |
name: ${{ needs.setup.outputs.environment }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Repository | |
uses: actions/checkout@v4 | |
- name: Dependencies | |
working-directory: ./ | |
run: npm run ci:all | |
- name: Spell check | |
working-directory: ./ | |
run: npm run spellcheck | |
# 4. Licensing - SCA | |
license: | |
name: Licensing βοΈ | |
needs: setup | |
environment: | |
name: ${{ needs.setup.outputs.environment }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Repository | |
uses: actions/checkout@v4 | |
- name: Fossa | |
uses: fossas/fossa-action@main | |
with: | |
api-key: ${{ secrets.FOSSA_API_KEY }} |