-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from Accenture/ci/add-code-quality-tooling
Ci/add code quality tooling
- Loading branch information
Showing
5 changed files
with
142 additions
and
36 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
extends: | ||
- '@commitlint/config-conventional' | ||
rules: | ||
# Scope enum should be customized to match project needs | ||
scope-enum: | ||
- 2 | ||
- always | ||
- ['deps'] | ||
# Type enum should be consistent across data science projects | ||
type-enum: | ||
- 2 | ||
- always | ||
- - build | ||
- chore | ||
- ci | ||
- docs | ||
- feat | ||
- fix | ||
- perf | ||
- refactor | ||
- revert | ||
- style | ||
- test | ||
- data | ||
- explore | ||
- result |
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,42 +1,47 @@ | ||
name: Create and publish a Docker image | ||
name: Build | ||
|
||
on: | ||
push: | ||
branches: ['main'] | ||
workflow_run: | ||
workflows: | ||
- Linting | ||
types: | ||
- completed | ||
branches: | ||
- main | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: accenture/federated-catalogue-viewer | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: accenture/federated-catalogue-viewer | ||
|
||
jobs: | ||
build-and-push-image: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v6 | ||
with: | ||
platforms: linux/amd64,linux/arm64 | ||
context: . | ||
push: true | ||
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest | ||
build-and-push-image: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v6 | ||
with: | ||
platforms: linux/amd64,linux/arm64 | ||
context: . | ||
push: true | ||
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Linting | ||
on: | ||
push: | ||
|
||
env: | ||
PYTHON_VERSION: 3.12 | ||
NODE_VERSION: 18.12 | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
- uses: pre-commit/[email protected] |
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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
default_install_hook_types: [pre-commit, commit-msg] | ||
default_stages: [commit, manual] | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v3.4.0 | ||
hooks: | ||
- id: check-added-large-files | ||
args: | ||
- '--maxkb=10000' | ||
- id: end-of-file-fixer | ||
- id: check-json | ||
- id: check-toml | ||
- id: check-xml | ||
- id: check-case-conflict | ||
- id: check-symlinks | ||
- id: check-merge-conflict | ||
stages: | ||
- commit | ||
- merge-commit | ||
- manual | ||
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook | ||
rev: v9.16.0 | ||
hooks: | ||
- id: commitlint | ||
additional_dependencies: ['@commitlint/config-conventional'] | ||
stages: | ||
- commit-msg | ||
- repo: https://github.com/prettier/pre-commit | ||
rev: v2.1.2 | ||
hooks: | ||
- id: prettier | ||
- repo: https://github.com/pre-commit/mirrors-eslint | ||
rev: 'v9.6.0' | ||
hooks: | ||
- id: eslint | ||
args: | ||
- '--fix' | ||
- '--config' | ||
- 'eslint.config.js' | ||
additional_dependencies: | ||
- [email protected] | ||
- '@eslint/[email protected]' | ||
- '[email protected]' | ||
- '[email protected]' | ||
- [email protected] | ||
files: \.(ts|html)$ | ||
types: [file] |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"singleQuote": true, | ||
"trailingComma": "all", | ||
"tabWidth": 4, | ||
"arrowParens": "always", | ||
"quoteProps": "consistent", | ||
"printWidth": 120 | ||
} |