Skip to content

Commit

Permalink
chore: maintenance (#280)
Browse files Browse the repository at this point in the history
  • Loading branch information
ThirdEyeSqueegee authored Oct 2, 2024
1 parent 7223af5 commit bddbcce
Show file tree
Hide file tree
Showing 15 changed files with 256 additions and 321 deletions.
2 changes: 2 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
Checks: "-*,clang-analyzer-*,concurrency-*,misc-*,performance-*,bugprone-*,-bugprone-narrowing-conversions,-bugprone-easily-swappable-parameters,cert-err52-cpp,cert-err60-cpp,cert-err34-c,cert-mem57-cpp,cert-msc50-cpp,cert-env33-c,cert-oop58-cpp,cert-oop57-cpp,cert-msc51-cpp,cert-dcl58-cpp,cert-flp30-c,cppcoreguidelines-*,-cppcoreguidelines-macro-to-enum,-cppcoreguidelines-non-private-member-variables-in-classes,-cppcoreguidelines-pro-type-reinterpret-cast,-cppcoreguidelines-use-default-member-init,-cppcoreguidelines-explicit-virtual-functions,-cppcoreguidelines-noexcept-swap,-cppcoreguidelines-narrowing-conversions,-cppcoreguidelines-noexcept-destructor,-cppcoreguidelines-c-copy-assignment-signature,-cppcoreguidelines-avoid-magic-numbers,-cppcoreguidelines-avoid-c-arrays,-cppcoreguidelines-noexcept-move-operations,google-build-namespaces,google-default-arguments,google-build-explicit-make-pair,google-runtime-int,google-runtime-operator,google-explicit-constructor,hicpp-multiway-paths-covered,hicpp-no-assembler,hicpp-exception-baseclass,hicpp-signed-bitwise,-misc-non-private-member-variables-in-classes,modernize-*,-modernize-use-trailing-return-type,readability-*,-readability-function-size,-readability-avoid-const-params-in-decls,-readability-identifier-length,-readability-implicit-bool-conversion,-readability-magic-numbers,-readability-qualified-auto,-readability-redundant-member-init,-readability-function-cognitive-complexity,-readability-identifier-naming,-*-include-cleaner"
19 changes: 19 additions & 0 deletions .clangd
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
CompileFlags:
Compiler: clang-cl

Index:
StandardLibrary: Yes

Diagnostics:
ClangTidy:
FastCheckFilter: Loose

Hover:
ShowAKA: Yes

---
If:
PathMatch: ../CommonLibSSE-NG

Index:
Background: Skip
44 changes: 44 additions & 0 deletions .github/update_vcpkg_baselines.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
from json import dumps, load
from re import sub
from subprocess import run

vcpkg_repo = "https://github.com/microsoft/vcpkg"
custom_vcpkg_registry_repo = "https://github.com/ThirdEyeSqueegee/vcpkg-ports"

vcpkg_ref = (
run(["git", "ls-remote", vcpkg_repo, "refs/heads/master"], capture_output=True)
.stdout.decode()
.splitlines()[0]
.split()[0]
)

custom_vcpkg_registry_ref = (
run(["git", "ls-remote", custom_vcpkg_registry_repo], capture_output=True)
.stdout.decode()
.splitlines()[0]
.split()[0]
)

with open("./vcpkg.json") as f:
vcpkg_json = load(f)

vcpkg_json["builtin-baseline"] = vcpkg_ref
vcpkg_json["vcpkg-configuration"]["registries"][0]["baseline"] = (
custom_vcpkg_registry_ref
)

vcpkg_json_str = dumps(vcpkg_json, indent=2)
vcpkg_json_str += "\n"

with open("./vcpkg.json", "w", newline="\r\n") as f:
f.write(vcpkg_json_str)

with open("./.github/workflows/main_ci.yml") as f:
main_ci_yml = f.read()

main_ci_yml = sub(
r"(VCPKG_COMMIT_ID: ).*", f"VCPKG_COMMIT_ID: {vcpkg_ref}", main_ci_yml
)

with open("./.github/workflows/main_ci.yml", "w") as f:
f.write(main_ci_yml)
File renamed without changes.
12 changes: 10 additions & 2 deletions .github/workflows/main_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,32 @@ name: Main CI [CMake]
on:
pull_request:
branches: main
types: [opened, synchronize, ready_for_review]
paths:
- "src/**"
- "include/**"
- ".github/workflows/main_ci.yml"
- "cmake/**"
- "include/**"
- "src/**"
- "CMakeLists.txt"
- "CMakePresets.json"
- "vcpkg.json"
workflow_dispatch:

concurrency:
group: main-ci
cancel-in-progress: true

jobs:
build-cmake:
runs-on: windows-latest

strategy:
fail-fast: false
matrix:
compiler:
- msvc
- clang-cl

steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
12 changes: 4 additions & 8 deletions .github/workflows/maintenance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ on:
push:
branches: main
paths:
- "src/**"
- "include/**"
- "src/**"
workflow_dispatch:

concurrency:
Expand All @@ -15,7 +15,9 @@ concurrency:
jobs:
maintenance:
runs-on: ubuntu-latest

if: github.repository_owner == 'Starfield-Reverse-Engineering'

steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -25,13 +27,7 @@ jobs:
run: "& ${{ github.workspace }}/.github/make-directives.ps1 ${{ github.workspace }}"

- name: Run clang-format
uses: DoozyX/[email protected]
with:
source: "."
exclude: "./docs"
extensions: "c,cc,cpp,cppm,cxx,h,hpp,hxx,inl,inc,ixx,mxx"
clangFormatVersion: 17
inplace: True
uses: jayllyz/clang-format-action@v1

- name: Add & Commit
id: registry
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/update_vcpkg_baselines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Update vcpkg baselines

on:
schedule:
- cron: 0 */6 * * *
repository_dispatch:
types: [update-baselines-event]
workflow_dispatch:

permissions: write-all

concurrency:
group: update-vcpkg-baselines
cancel-in-progress: true

jobs:
update-vcpkg-baselines:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.EDIT_WORKFLOW_TOKEN }}

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.12

- run: python .github/update_vcpkg_baselines.py

- name: Add & Commit
uses: EndBug/add-and-commit@v9
with:
default_author: github_actions
message: "ci: update vcpkg baselines"
Loading

0 comments on commit bddbcce

Please sign in to comment.