Skip to content

Commit 7e0a792

Browse files
committed
feat: platform integrity checker
0 parents  commit 7e0a792

File tree

93 files changed

+63063
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+63063
-0
lines changed

.dockerignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.idea/
2+
.github/
3+
.vscode/
4+
5+
**/bin/
6+
**/obj/
7+
8+
compose.yaml
9+
**/Dockerfile

.github/CODEOWNERS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# These owners will be the default owners for everything in the repo. Unless a
2+
# later match takes precedence, the PSI team will be requested for review when
3+
# someone opens a pull request.
4+
* @ansys/psi

.github/labeler.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# This file is required by the the action 'https://github.com/actions/labeler'
2+
# and used in the '.github/workflows/ci_cd_pr.yml' workflow
3+
4+
# -- Labels based on PR title ------------------------------------------------
5+
'fix':
6+
- head-branch: ['fix']
7+
8+
'enhancement':
9+
- head-branch: ['feat']
10+
11+
# -- Documentation labels ----------------------------------------------------
12+
'docs':
13+
- all:
14+
- changed-files:
15+
- any-glob-to-any-file: ['doc/source/**/*.rst', 'README.md', 'CONTRIBUTING.md', CONTRIBUTORS.md', 'LICENSE', 'AUTHORS.md']
16+
- all-globs-to-all-files: ['!doc/source/examples.rst', '!doc/source/api/**/*.rst', '!doc/styles/**', '!doc/.vale.ini']
17+
18+
'docs:api':
19+
- any:
20+
- changed-files:
21+
- any-glob-to-any-file: ['doc/source/api/**/*.rst']
22+
23+
'docs:examples':
24+
- any:
25+
- changed-files:
26+
- any-glob-to-any-file: ['examples/**/*.py', 'doc/source/examples.rst']
27+
28+
## -- Other labels ------------------------------------------------------------
29+
'style:code':
30+
- any:
31+
- changed-files:
32+
- any-glob-to-any-file: ['.pre-commit-config.yaml', 'doc/.vale.ini']
33+
34+
'docker':
35+
- any:
36+
- changed-files:
37+
- any-glob-to-any-file: ['pic.Web/Dockerfile', 'pic.ApiService/Dockerfile']
38+
39+
'ci':
40+
- any:
41+
- changed-files:
42+
- any-glob-to-any-file: ['.github/workflows/**']
43+
44+
'tests':
45+
- any:
46+
- changed-files:
47+
- any-glob-to-any-file: ['tests/**']
48+
49+
# HACK: the following labels are declared with the only purpose of avoiding the
50+
# GitHub labeler bot to remove those. This is a known issue reported in the
51+
# official action/labeler repo https://github.com/actions/labeler/issues/763
52+
53+
'ci:skip':
54+
- all:
55+
- changed-files:
56+
- all-globs-to-all-files: ['THIS-NEVER-MATCHES-A-FILE']
57+
58+
'docs:skip':
59+
- all:
60+
- changed-files:
61+
- all-globs-to-all-files: ['THIS-NEVER-MATCHES-A-FILE']
62+
63+
'tests:skip':
64+
- all:
65+
- changed-files:
66+
- all-globs-to-all-files: ['THIS-NEVER-MATCHES-A-FILE']

.github/labels.yml

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# The labels declared in this file are the ones avialables
2+
# https://github.com/ansys-internal/platform-integrity-checker/labels
3+
4+
# -- Defects and glitches labels----------------------------------------------
5+
6+
- name: 'bug'
7+
description: Defects or glitches reported by users or developers
8+
color: d42a34
9+
10+
- name: 'fix'
11+
description: Pull requests related to resolving problems or errors
12+
color: d42a34
13+
14+
# -- Style labels ------------------------------------------------------------
15+
16+
- name: 'style'
17+
description: Improvements related to general project style
18+
color: dcbeff
19+
20+
- name: 'style:code'
21+
description: Improvements related to code style
22+
color: dcbeff
23+
24+
- name: 'style:docs'
25+
description: Improvements related to doc style
26+
color: dcbeff
27+
28+
- name: 'style:branch-name'
29+
description: Verifies branch name is compliant with PyAnsys guidelines
30+
color: dcbeff
31+
32+
- name: 'style:skip'
33+
description: Skip style runs in CI/CD
34+
color: dcbeff
35+
36+
# -- Tests labels ------------------------------------------------------------
37+
38+
- name: 'tests'
39+
description: Related with improvements of the test suite
40+
color: ffd8b1
41+
42+
- name: 'tests:skip'
43+
description: Skip tests runs in CI/CD
44+
color: ffd8b1
45+
46+
# -- Documentation labels ----------------------------------------------------
47+
48+
- name: 'docs'
49+
description: Issues related to documentation
50+
color: 0677ba
51+
52+
- name: 'docs:api'
53+
description: Related to API documentation
54+
color: 0677ba
55+
56+
- name: 'docs:examples'
57+
description: Related to documentation examples
58+
color: 0677ba
59+
60+
- name: 'docs:skip'
61+
description: Skip documentation runs in CI/CD
62+
color: 0677ba
63+
64+
# -- Dependencies labels -----------------------------------------------------
65+
66+
- name: 'dependencies'
67+
description: Related with project dependencies
68+
color: fabed4
69+
70+
- name: 'dependencies:pyproject'
71+
description: Related with project file dependencies
72+
color: fabed4
73+
74+
- name: 'dependencies:ci'
75+
description: Related with pipelines dependencies
76+
color: fabed4
77+
78+
# -- CI/CD labels ------------------------------------------------------------
79+
80+
- name: 'ci'
81+
description: Pipelines maintenance related
82+
color: a9a9a9
83+
84+
- name: 'ci:skip'
85+
description: Skip CI/CD runs
86+
color: a9a9a9
87+
88+
# -- Other labels ------------------------------------------------------------
89+
90+
- name: 'release'
91+
description: Anything related to an incoming release
92+
color: ffffff
93+
94+
- name: 'good first issue'
95+
description: Issues suitable for newcomers or those with less experience
96+
color: 62ca50
97+
98+
- name: 'enhancement'
99+
description: General improvements to existing features
100+
color: ffd827
101+
102+
- name: 'maintenance'
103+
description: Generic maintenance related
104+
color: f78c37
105+
106+
- name: 'docker'
107+
description: Docker maintenance related
108+
color: 000075

.github/workflows/ci_cd.yml

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
name: CI
2+
on:
3+
push:
4+
branches:
5+
- 'release/*.*'
6+
- 'main'
7+
tags:
8+
- "v*.*.*"
9+
pull_request:
10+
types: [opened, synchronize, reopened, labeled]
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
18+
labeler:
19+
name: "Labels"
20+
permissions:
21+
contents: read
22+
pull-requests: write
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: "Checkotu project"
26+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2
27+
28+
- name: "Update labels"
29+
uses: micnncim/action-label-syncer@3abd5ab72fda571e69fffd97bd4e0033dd5f495c # v1.3.0
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
33+
- name: "Label pull-request"
34+
uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5.0.0
35+
with:
36+
repo-token: ${{ secrets.GITHUB_TOKEN }}
37+
38+
check-pr-title:
39+
name: "Check pull-request title follows conventional commits"
40+
runs-on: ubuntu-latest
41+
needs: labeler
42+
steps:
43+
- uses: ansys/actions/check-pr-title@1f1f205361706d22f67c71c29b775222380cd95a # v9.0.6
44+
with:
45+
token: ${{ secrets.GITHUB_TOKEN }}
46+
47+
code-style:
48+
name: "Code style checks"
49+
runs-on: ubuntu-latest
50+
needs: check-pr-title
51+
steps:
52+
- uses: ansys/actions/code-style@1f1f205361706d22f67c71c29b775222380cd95a # v9.0.6
53+
with:
54+
python-version: ${{ env.MAIN_PYTHON_VERSION }}
55+
56+
docker-style:
57+
name: "Docker style ${{ matrix.directory }}"
58+
runs-on: ubuntu-latest
59+
needs: check-pr-title
60+
strategy:
61+
fail-fast: false
62+
matrix:
63+
directory: ['pic.Web', 'pic.ApiService']
64+
steps:
65+
- uses: ansys/actions/[email protected]
66+
with:
67+
directory: ${{ matrix.directory }}
68+
recursive: true
69+
error-level: 1
70+
71+
docker-build:
72+
name: "Build ${{ matrix.directory }}"
73+
runs-on: ubuntu-latest
74+
needs: [code-style, docker-style]
75+
permissions:
76+
contents: read
77+
packages: write
78+
env:
79+
REGISTRY: ghcr.io
80+
IMAGE_VERSION: ${{ github.ref_name }}
81+
steps:
82+
83+
- name: "Checkout project"
84+
uses: actions/checkout@v4
85+
86+
- name: "Set environment variables"
87+
run: |
88+
echo "CREATED_AT=$(date --rfc-3339=seconds)" >> "$GITHUB_ENV"
89+
echo "REVISION=$(git rev-parse HEAD)" >> "$GITHUB_ENV"
90+
91+
# Remove leading 'v' from version tag if it exists
92+
RAW_VERSION="${GITHUB_REF_NAME}"
93+
IMAGE_VERSION="${RAW_VERSION#v}"
94+
echo "IMAGE_VERSION=$IMAGE_VERSION" >> "$GITHUB_ENV"
95+
96+
- name: "Log in to GitHub Container Registry"
97+
uses: docker/login-action@v3
98+
with:
99+
registry: ${{ env.REGISTRY }}
100+
username: ${{ github.actor }}
101+
password: ${{ secrets.GITHUB_TOKEN }}
102+
103+
- name: "Build images with Docker Compose"
104+
run: |
105+
docker compose build \
106+
--build-arg CREATED_AT="${CREATED_AT}" \
107+
--build-arg REVISION="${REVISION}" \
108+
--build-arg VERSION="${IMAGE_VERSION}"
109+
110+
- name: "Tag images"
111+
if: github.ref_type == 'tag'
112+
run: |
113+
docker tag pic/frontend $REGISTRY/${{ github.repository }}:pic-frontend-${IMAGE_VERSION}
114+
docker tag pic/backend $REGISTRY/${{ github.repository }}:pic-backend-${IMAGE_VERSION}
115+
116+
- name: "Push images"
117+
if: github.ref_type == 'tag'
118+
run: |
119+
docker push $REGISTRY/${{ github.repository }}:pic-frontend-${IMAGE_VERSION}
120+
docker push $REGISTRY/${{ github.repository }}:pic-backend-${IMAGE_VERSION}

.gitignore

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Visual Studio 2015 and VS Code cache/options directories
2+
.vs/
3+
# User-specific files
4+
*.suo
5+
*.user
6+
*.userosscache
7+
*.sln.docstates
8+
9+
# Visual studio code local settings
10+
.vscode/
11+
*.code-workspace
12+
13+
# Node.js Tools for Visual Studio
14+
.ntvs_analysis.dat
15+
**/node_modules/
16+
17+
# JetBrains Rider
18+
.idea/
19+
*.sln.iml
20+
21+
# Bazel build results
22+
/bazel-*
23+
# Bazel user config
24+
user.bazelrc
25+
26+
#rust-analyzer
27+
rust-project.json
28+
29+
# useless directory due to our setup.py at the root of the repository
30+
UNKNOWN.egg-info/
31+
32+
# paket
33+
paket-files/
34+
35+
# C#
36+
**/obj
37+
38+
# Structurizr
39+
**/.structurizr/
40+
41+
# MacOS Finder file
42+
.DS_Store
43+
44+
#.terraform
45+
**/.terraform/
46+
# Binaries
47+
*.tgz
48+
*.tar.gz
49+
*.zip
50+
*.tar.xz
51+
*.7z
52+
*.rar
53+
*.iso
54+
*.dmg
55+
*.jar
56+
*.gz
57+
58+
.hugo_build.lock
59+
60+
# C#
61+
**/bin/
62+
**/obj/
63+
64+
# Secrets
65+
**/*.lic

0 commit comments

Comments
 (0)