Fix dynamic variable assignment for pylint #725
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
name: Build C++ utility | |
on: | |
push: | |
paths: | |
- 'src/**/*.cpp' | |
- '.github/workflows/*.yml' | |
pull_request: | |
paths: | |
- 'src/**/*.cpp' | |
workflow_dispatch: | |
jobs: | |
checkout: | |
runs-on: windows-latest | |
outputs: | |
checkout-path: ${{ steps.upload-artifact.outputs.artifact-path }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Upload checkout files as artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: source | |
path: src | |
build-msvc: | |
runs-on: windows-latest | |
needs: checkout | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Enable Developer Command Prompt | |
uses: ilammy/[email protected] | |
- name: Compile and build source files | |
shell: cmd | |
run: | | |
cl | |
cl /std:c++20 /O2 /W4 /LD /EHsc /DLL /MT /Fe:src\dlls\api.dll src/api.cpp src/settings.cpp src/asteroids.cpp /link user32.lib shell32.lib gdi32.lib wininet.lib | |
cl /std:c++20 /O2 /W4 /LD /EHsc /DLL /MT /Fe:src\dlls\gui.dll src/gui.cpp src/settings.cpp src/asteroids.cpp src/system.cpp src/api.cpp /link advapi32.lib user32.lib shell32.lib gdi32.lib wininet.lib comctl32.lib | |
build-gcc: | |
runs-on: windows-latest | |
needs: checkout | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Compile and build source files | |
shell: cmd | |
run: | | |
rm -rf src/dlls/* | |
g++ --version | |
g++ -O2 -march=alderlake -mtune=alderlake -msse4.2 -mavx -funroll-loops -flto -Wextra -shared -std=c++20 -Wmissing-field-initializers -static -o src/dlls/api.dll src/api.cpp src/settings.cpp src/asteroids.cpp -lgdi32 -lwininet | |
g++ -O2 -march=alderlake -mtune=alderlake -msse4.2 -mavx -funroll-loops -flto -Wextra -Wcast-function-type -Wmissing-field-initializers -shared -std=c++20 -static -o src/dlls/gui.dll src/gui.cpp src/settings.cpp src/asteroids.cpp src/system.cpp src/api.cpp -lgdi32 -lwininet -lcomctl32 | |
- name: Commit and push .dll files | |
run: | | |
git config --global user.name "Ethan Chan" | |
git config --global user.email "[email protected]" | |
git add . -f | |
git commit -m "Auto-build DLL files using g++" || echo "No changes to commit" | |
git push https://[email protected]/eschan145/DieKnow.git main | |
env: | |
# A GitHub PAT must be set up as an Actions secret in the repository | |
GH_PAT: ${{ secrets.GH_PAT }} | |
build-clang: | |
runs-on: windows-latest | |
needs: checkout | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Compile and build source files | |
shell: cmd | |
run: | | |
clang++ --version | |
clang++ -O2 -Wextra -shared -std=c++20 -Wmissing-field-initializers -static -o src/dlls/api.dll src/api.cpp src/settings.cpp src/asteroids.cpp -luser32 -lshell32 -lgdi32 -lwininet | |
clang++ -O2 -Wextra -Wcast-function-type -Wmissing-field-initializers -shared -std=c++20 -static -o src/dlls/gui.dll src/gui.cpp src/settings.cpp src/asteroids.cpp src/system.cpp src/api.cpp -luser32 -lshell32 -ladvapi32 -lgdi32 -lwininet -lcomctl32 | |
build-documentation: | |
needs: [build-msvc, build-gcc, build-clang] | |
runs-on: windows-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Build docs | |
shell: cmd | |
run: | | |
git pull --force | |
py src/dieknow.py -docs | |
echo "Generated documentation" | |
- name: Commit and push generated documentation files | |
run: | | |
git config --global user.name "Ethan Chan" | |
git config --global user.email "[email protected]" | |
git add . -f | |
git rm --cached *.pyc | |
git commit -m "Automated documentation update" || echo "No changes to commit" | |
git push https://[email protected]/eschan145/DieKnow.git main | |
env: | |
# A GitHub PAT must be set up as an Actions secret in the repository | |
GH_PAT: ${{ secrets.GH_PAT }} | |
verify-libraries: | |
needs: [build-msvc, build-gcc, build-clang] | |
runs-on: windows-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Use ls to check DLLs | |
shell: cmd | |
run: | | |
ls -l src/dlls/api.dll | |
ls -l src/dlls/gui.dll |