Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# These owners will be the default owners for everything in the repo. Unless a
# later match takes precedence, the PSI team will be requested for review when
# someone opens a pull request.
* @ansys/psi
66 changes: 66 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# This file is required by the the action 'https://github.com/actions/labeler'
# and used in the '.github/workflows/ci_cd_pr.yml' workflow

# -- Labels based on PR title ------------------------------------------------
'fix':
- head-branch: ['fix']

'enhancement':
- head-branch: ['feat']

# -- Documentation labels ----------------------------------------------------
'docs':
- all:
- changed-files:
- any-glob-to-any-file: ['doc/source/**/*.rst', 'README.md', 'CONTRIBUTING.md', CONTRIBUTORS.md', 'LICENSE', 'AUTHORS.md']
- all-globs-to-all-files: ['!doc/source/examples.rst', '!doc/source/api/**/*.rst', '!doc/styles/**', '!doc/.vale.ini']

'docs:api':
- any:
- changed-files:
- any-glob-to-any-file: ['doc/source/api/**/*.rst']

'docs:examples':
- any:
- changed-files:
- any-glob-to-any-file: ['examples/**/*.py', 'doc/source/examples.rst']

## -- Other labels ------------------------------------------------------------
'style:code':
- any:
- changed-files:
- any-glob-to-any-file: ['.pre-commit-config.yaml', 'doc/.vale.ini']

'docker':
- any:
- changed-files:
- any-glob-to-any-file: ['pic.Web/Dockerfile', 'pic.ApiService/Dockerfile']

'ci':
- any:
- changed-files:
- any-glob-to-any-file: ['.github/workflows/**']

'tests':
- any:
- changed-files:
- any-glob-to-any-file: ['tests/**']

# HACK: the following labels are declared with the only purpose of avoiding the
# GitHub labeler bot to remove those. This is a known issue reported in the
# official action/labeler repo https://github.com/actions/labeler/issues/763

'ci:skip':
- all:
- changed-files:
- all-globs-to-all-files: ['THIS-NEVER-MATCHES-A-FILE']

'docs:skip':
- all:
- changed-files:
- all-globs-to-all-files: ['THIS-NEVER-MATCHES-A-FILE']

'tests:skip':
- all:
- changed-files:
- all-globs-to-all-files: ['THIS-NEVER-MATCHES-A-FILE']
108 changes: 108 additions & 0 deletions .github/labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# The labels declared in this file are the ones avialables
# https://github.com/ansys-internal/platform-integrity-checker/labels

# -- Defects and glitches labels----------------------------------------------

- name: 'bug'
description: Defects or glitches reported by users or developers
color: d42a34

- name: 'fix'
description: Pull requests related to resolving problems or errors
color: d42a34

# -- Style labels ------------------------------------------------------------

- name: 'style'
description: Improvements related to general project style
color: dcbeff

- name: 'style:code'
description: Improvements related to code style
color: dcbeff

- name: 'style:docs'
description: Improvements related to doc style
color: dcbeff

- name: 'style:branch-name'
description: Verifies branch name is compliant with PyAnsys guidelines
color: dcbeff

- name: 'style:skip'
description: Skip style runs in CI/CD
color: dcbeff

# -- Tests labels ------------------------------------------------------------

- name: 'tests'
description: Related with improvements of the test suite
color: ffd8b1

- name: 'tests:skip'
description: Skip tests runs in CI/CD
color: ffd8b1

# -- Documentation labels ----------------------------------------------------

- name: 'docs'
description: Issues related to documentation
color: 0677ba

- name: 'docs:api'
description: Related to API documentation
color: 0677ba

- name: 'docs:examples'
description: Related to documentation examples
color: 0677ba

- name: 'docs:skip'
description: Skip documentation runs in CI/CD
color: 0677ba

# -- Dependencies labels -----------------------------------------------------

- name: 'dependencies'
description: Related with project dependencies
color: fabed4

- name: 'dependencies:pyproject'
description: Related with project file dependencies
color: fabed4

- name: 'dependencies:ci'
description: Related with pipelines dependencies
color: fabed4

# -- CI/CD labels ------------------------------------------------------------

- name: 'ci'
description: Pipelines maintenance related
color: a9a9a9

- name: 'ci:skip'
description: Skip CI/CD runs
color: a9a9a9

# -- Other labels ------------------------------------------------------------

- name: 'release'
description: Anything related to an incoming release
color: ffffff

- name: 'good first issue'
description: Issues suitable for newcomers or those with less experience
color: 62ca50

- name: 'enhancement'
description: General improvements to existing features
color: ffd827

- name: 'maintenance'
description: Generic maintenance related
color: f78c37

- name: 'docker'
description: Docker maintenance related
color: 000075
120 changes: 120 additions & 0 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
name: CI
on:
push:
branches:
- 'release/*.*'
- 'main'
tags:
- "v*.*.*"
pull_request:
types: [opened, synchronize, reopened, labeled]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:

labeler:
name: "Labels"
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: "Checkotu project"
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2

- name: "Update labels"
uses: micnncim/action-label-syncer@3abd5ab72fda571e69fffd97bd4e0033dd5f495c # v1.3.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: "Label pull-request"
uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5.0.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

check-pr-title:
name: "Check pull-request title follows conventional commits"
runs-on: ubuntu-latest
needs: labeler
steps:
- uses: ansys/actions/check-pr-title@1f1f205361706d22f67c71c29b775222380cd95a # v9.0.6
with:
token: ${{ secrets.GITHUB_TOKEN }}

code-style:
name: "Code style checks"
runs-on: ubuntu-latest
needs: check-pr-title
steps:
- uses: ansys/actions/code-style@1f1f205361706d22f67c71c29b775222380cd95a # v9.0.6
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}

docker-style:
name: "Docker style ${{ matrix.directory }}"
runs-on: ubuntu-latest
needs: check-pr-title
strategy:
fail-fast: false
matrix:
directory: ['pic.Web', 'pic.ApiService']
steps:
- uses: ansys/actions/docker-style@v9.0
with:
directory: ${{ matrix.directory }}
recursive: true
error-level: 1

docker-build:
name: "Build ${{ matrix.directory }}"
runs-on: ubuntu-latest
needs: [code-style, docker-style]
permissions:
contents: read
packages: write
env:
REGISTRY: ghcr.io
IMAGE_VERSION: ${{ github.ref_name }}
steps:

- name: "Checkout project"
uses: actions/checkout@v4

- name: "Set environment variables"
run: |
echo "CREATED_AT=$(date --rfc-3339=seconds)" >> "$GITHUB_ENV"
echo "REVISION=$(git rev-parse HEAD)" >> "$GITHUB_ENV"

# Remove leading 'v' from version tag if it exists
RAW_VERSION="${GITHUB_REF_NAME}"
IMAGE_VERSION="${RAW_VERSION#v}"
echo "IMAGE_VERSION=$IMAGE_VERSION" >> "$GITHUB_ENV"

- name: "Log in to GitHub Container Registry"
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: "Build images with Docker Compose"
run: |
docker compose build \
--build-arg CREATED_AT="${CREATED_AT}" \
--build-arg REVISION="${REVISION}" \
--build-arg VERSION="${IMAGE_VERSION}"

- name: "Tag images"
if: github.ref_type == 'tag'
run: |
docker tag pic/frontend $REGISTRY/${{ github.repository }}:pic-frontend-${IMAGE_VERSION}
docker tag pic/backend $REGISTRY/${{ github.repository }}:pic-backend-${IMAGE_VERSION}

- name: "Push images"
if: github.ref_type == 'tag'
run: |
docker push $REGISTRY/${{ github.repository }}:pic-frontend-${IMAGE_VERSION}
docker push $REGISTRY/${{ github.repository }}:pic-backend-${IMAGE_VERSION}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ paket-files/
**/obj/

# Secrets
**/*.lic
**/*.lic
21 changes: 21 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
repos:

- repo: https://github.com/ansys/pre-commit-hooks
rev: v0.5.2
hooks:
- id: add-license-headers
args:
- --start_year=2025

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.33.0
hooks:
- id: check-github-workflows

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-merge-conflict
- id: debug-statements
- id: check-yaml
- id: trailing-whitespace
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# Contributing

Contributions to this repository are welcome.
4 changes: 2 additions & 2 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

## Project Lead

* [Romain Vasseur](https://github.com/RVR06)
* [Mathilde Gallouet](https://github.com/mgalloue)

## Individual Contributors

* [Mathilde Gallouet](https://github.com/mgalloue)
* [Romain Vasseur](https://github.com/RVR06)
14 changes: 7 additions & 7 deletions pic.ApiService/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
RUN dotnet restore pic.ApiService/pic.ApiService.csproj \
-r linux-x64

RUN dotnet publish pic.ApiService/pic.ApiService.csproj \

Check notice on line 10 in pic.ApiService/Dockerfile

View workflow job for this annotation

GitHub Actions / Docker style pic.ApiService

Multiple consecutive `RUN` instructions. Consider consolidation.
--no-restore \
-c Release \
-r linux-x64 \
Expand All @@ -21,12 +21,12 @@
COPY --from=build /app/publish .
EXPOSE 8080

LABEL org.opencontainers.image.authors="Ansys PSI team <PlatformServicesandIntegration@ansys.com>"
LABEL org.opencontainers.image.vendor="ANSYS Inc."
LABEL org.opencontainers.image.title="pic backend"
LABEL org.opencontainers.image.description="Plateform Integrity Checker backend"
LABEL org.opencontainers.image.created=${CREATED_AT}
LABEL org.opencontainers.image.revision=${REVISION}
LABEL org.opencontainers.image.version=${VERSION}
LABEL org.opencontainers.image.authors="Ansys PSI team" \
org.opencontainers.image.vendor="ANSYS Inc." \
org.opencontainers.image.title="pic backend" \
org.opencontainers.image.description="Plateform Integrity Checker backend" \
org.opencontainers.image.created=${CREATED_AT} \
org.opencontainers.image.revision=${REVISION} \
org.opencontainers.image.version=${VERSION}

ENTRYPOINT ["./pic.ApiService"]
2 changes: 1 addition & 1 deletion pic.ApiService/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

app.MapDefaultEndpoints();

app.Logger.LogInformation("Silencing probes {SilentProbes}",
app.Logger.LogInformation("Silencing probes {SilentProbes}",
builder.Configuration.GetValue<bool>("SilentProbes"));

app.Run();
Expand Down
14 changes: 7 additions & 7 deletions pic.Web/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
RUN dotnet restore pic.Web/pic.Web.csproj \
-r linux-x64

RUN dotnet publish pic.Web/pic.Web.csproj \

Check notice on line 10 in pic.Web/Dockerfile

View workflow job for this annotation

GitHub Actions / Docker style pic.Web

Multiple consecutive `RUN` instructions. Consider consolidation.
--no-restore \
-c Release \
-r linux-x64 \
Expand All @@ -21,12 +21,12 @@
COPY --from=build /app/publish .
EXPOSE 8080

LABEL org.opencontainers.image.authors="Ansys PSI team <PlatformServicesandIntegration@ansys.com>"
LABEL org.opencontainers.image.vendor="ANSYS Inc."
LABEL org.opencontainers.image.title="pic frontend"
LABEL org.opencontainers.image.description="Plateform Integrity Checker frontend"
LABEL org.opencontainers.image.created=${CREATED_AT}
LABEL org.opencontainers.image.revision=${REVISION}
LABEL org.opencontainers.image.version=${VERSION}
LABEL org.opencontainers.image.authors="Ansys PSI team" \
org.opencontainers.image.vendor="ANSYS Inc." \
org.opencontainers.image.title="pic frontend" \
org.opencontainers.image.description="Plateform Integrity Checker frontend" \
org.opencontainers.image.created=${CREATED_AT} \
org.opencontainers.image.revision=${REVISION} \
org.opencontainers.image.version=${VERSION}

ENTRYPOINT ["./pic.Web"]
Loading