generated from UK-Export-Finance/nestjs-template
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
89a6e5e
commit dc17ea5
Showing
7 changed files
with
137 additions
and
51 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,62 @@ | ||
# MDM-API Git Hub Actions | ||
##################################### | ||
# This GHA is responsible for initiating linting checks | ||
# Workflow Name: Lint | ||
# Trigger: Pull requests to the main branch that modify specific files (listed in paths). | ||
# | ||
# Environment: | ||
# environment: set to dev | ||
# timezone: retrieved from vars.TIMEZONE | ||
# | ||
# Setup Test Infrastructure: | ||
# Name: Infrastructure setup | ||
# Runs on: ubuntu-latest | ||
# Outputs environment and timezone variables for use in subsequent jobs. | ||
# Steps: | ||
# Echoes the environment and timezone for verification. | ||
# | ||
# Lint: | ||
# Name: Scanning | ||
# Depends on: setup | ||
# Runs on: ubuntu-latest | ||
# Steps: | ||
# Sets the timezone using the specified value. | ||
# Checks out the repository code. | ||
# Sets up the specified Node.js version. | ||
# Installs dependencies using npm run ci:all. | ||
# Runs linting using the command npm run lint:all. | ||
# | ||
# Key Points: | ||
# The workflow focuses on linting, which checks code for potential errors, style issues, and adherence to best practices. | ||
# It uses a sequential structure, with the linting job depending on the setup job. | ||
# Environment variables are shared between jobs for consistency. | ||
# The workflow leverages actions from the GitHub Marketplace for setting the timezone and installing Node.js. | ||
# | ||
|
||
name: Quality Assurance - Lint | ||
run-name: Executing lint QA on ${{ github.repository }} 🚀 | ||
name: Lint | ||
run-name: 🎨 Lint checking on ${{ github.event.number }} | ||
|
||
on: | ||
pull_request: | ||
branches: [main] | ||
branches: | ||
- main | ||
- "release-*" | ||
|
||
paths: | ||
- "src/**" | ||
- "test/**" | ||
- "package*.json" | ||
- "docker*.yml" | ||
- ".github/workflows/**" | ||
- "gef-ui/**" | ||
- "portal/**" | ||
- "portal-api/**" | ||
- "trade-finance-manager-ui/**" | ||
- "trade-finance-manager-api/**" | ||
- "external-api/**" | ||
- "dtfs-central-api/**" | ||
- "azure-functions/**" | ||
- "e2e-tests/**" | ||
- "utils/mock-data-loader/**" | ||
- "libs/**" | ||
|
||
env: | ||
environment: "qa" | ||
environment: dev | ||
timezone: ${{ vars.TIMEZONE }} | ||
|
||
jobs: | ||
|
@@ -39,15 +82,15 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- name: Timezone | ||
uses: szenius/set-timezone@v2.0 | ||
uses: szenius/set-timezone@v1.2 | ||
with: | ||
timezoneLinux: ${{ needs.setup.outputs.timezone }} | ||
|
||
- name: Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Node | ||
uses: actions/setup-node@v4 | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ vars.NODE_VERSION }} | ||
|
||
|
@@ -57,8 +100,33 @@ jobs: | |
|
||
- name: Linting | ||
working-directory: ./ | ||
run: npm run lint | ||
run: | ||
npm run lint:all | ||
|
||
- name: Prettier | ||
# 3. Lint | ||
prettier: | ||
name: Prettier 🎨 | ||
environment: | ||
name: ${{ needs.setup.outputs.environment }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Timezone | ||
uses: szenius/[email protected] | ||
with: | ||
timezoneLinux: ${{ needs.setup.outputs.timezone }} | ||
|
||
- name: Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ vars.NODE_VERSION }} | ||
|
||
- name: Dependencies | ||
working-directory: ./ | ||
run: npm ci --legacy-peer-deps | ||
|
||
- name: Linting | ||
working-directory: ./ | ||
run: npm run prettier |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,19 @@ | ||
# Root | ||
node_modules/ | ||
dist/ | ||
.cache/ | ||
build/ | ||
public/ | ||
generated_reports/ | ||
coverage/ | ||
package*.json | ||
.cache | ||
|
||
# Sub-directories | ||
**/node_modules/ | ||
**/dist/ | ||
**/build/ | ||
**/public/ | ||
**/**/**/generated_reports/ | ||
**/coverage/ | ||
**/node_modules/** | ||
/node_modules | ||
/package-lock.json | ||
**/package*.json | ||
**/.cache |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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