Skip to content

Commit

Permalink
WIP: Full tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SMoraisAnsys committed Jan 4, 2024
1 parent 325be75 commit e4cda71
Show file tree
Hide file tree
Showing 3 changed files with 161 additions and 2 deletions.
File renamed without changes.
125 changes: 123 additions & 2 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,139 @@ concurrency:

jobs:

docker-lint:
name: Dockerfile linting
docker-style-0:
name: FAIL - not allowed directory
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: PyAnsys dockerfile check
uses: ansys/actions/docker-style@feat/lint_dockerfile
with:
directory: docker_folder

docker-style-1:
name: FAIL - Allowed directory but no Dockerfile
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: PyAnsys dockerfile check
uses: ansys/actions/docker-style@feat/lint_dockerfile
with:
directory: .devcontainer

docker-style-2:
name: FAIL - Allowed directory but no recursive search
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: PyAnsys dockerfile check
uses: ansys/actions/docker-style@feat/lint_dockerfile
with:
directory: docker

docker-style-3:
name: FAIL - Allowed directory and recursive search but error level is set to info
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: PyAnsys dockerfile check
uses: ansys/actions/docker-style@feat/lint_dockerfile
with:
directory: docker
recursive: true

docker-style-4:
name: SUCCESS - Allowed directory and recursive search and error level is set to error
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: PyAnsys dockerfile check
uses: ansys/actions/docker-style@feat/lint_dockerfile
with:
directory: docker
recursive: true
error-level: 0









code-style-0:
name: FAIL - not allowed directory
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: PyAnsys dockerfile check
uses: ansys/actions/code-style@feat/lint_dockerfile
with:
directory: docker_folder

code-style-1:
name: FAIL - Allowed directory but no Dockerfile
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: PyAnsys dockerfile check
uses: ansys/actions/code-style@feat/lint_dockerfile
with:
directory: .devcontainer

code-style-2:
name: FAIL - Allowed directory but no recursive search
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: PyAnsys dockerfile check
uses: ansys/actions/code-style@feat/lint_dockerfile
with:
directory: docker

code-style-3:
name: FAIL - Allowed directory and recursive search but error level is set to info
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: PyAnsys dockerfile check
uses: ansys/actions/code-style@feat/lint_dockerfile
with:
directory: docker
recursive: true

code-style-4:
name: SUCCESS - Allowed directory and recursive search and error level is set to error
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: PyAnsys dockerfile check
uses: ansys/actions/code-style@feat/lint_dockerfile
with:
directory: docker
recursive: true
error-level: 0

# docker-lint:
# name: Dockerfile linting through code-style action
Expand Down
38 changes: 38 additions & 0 deletions docker_folder/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Geometry service Windows-based Dockerfile
#
# Based on mcr.microsoft.com/dotnet/framework/runtime:4.7.2-windowsservercore-ltsc2019
FROM mcr.microsoft.com/dotnet/framework/runtime:4.7.2-windowsservercore-ltsc2019

# Define the working directory - /temp
WORKDIR /temp

# Download Microsoft Visual C++ Redistributable x64
ADD https://aka.ms/vs/17/release/VC_redist.x64.exe VC_redist.x64.exe
RUN VC_redist.x64.exe /install /quiet /norestart

# Define the working directory - /app
WORKDIR /app

# Add the binary files from the latest release
COPY windows-binaries.zip .
RUN mkdir tmp_folder && tar -xf windows-binaries.zip -C tmp_folder
RUN xcopy "tmp_folder\DockerWindows\bin\x64\Release_Headless\net472\*" ".\" /s /e /i /h
RUN xcopy "tmp_folder\DockerWindows\*" ".\"
RUN del windows-binaries.zip && rmdir /s /q tmp_folder

# Defining environment variables
ENV LICENSE_SERVER=""
ENV SERVER_ENDPOINT="0.0.0.0:50051"
ENV ENABLE_TRACE=0
ENV LOG_LEVEL=2
ENV AWP_ROOT241=C:/app/unified

# Add container labels
LABEL org.opencontainers.image.authors="ANSYS Inc."
LABEL org.opencontainers.image.vendor="ANSYS Inc."

# Expose the Geometry service port
EXPOSE 50051

# Define the entrypoint for the Geometry service
ENTRYPOINT ["Presentation.ApiServerDMS.exe"]

0 comments on commit e4cda71

Please sign in to comment.