Skip to content
Closed
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
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"jetbrains.resharper.globaltools": {
"version": "2022.3.2",
"version": "2025.3.3",
"commands": [
"jb"
]
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pull-request-ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ jobs:
name: ["macOS", "windows-os"]
include:
- name: macOS
os: macOS-13
version: "14.2"
os: macos-26
version: "26.2"
osFolder: "maccatalyst"
- name: windows-os
os: windows-2022
Expand Down Expand Up @@ -113,7 +113,7 @@ jobs:
if: (runner.os == 'macOS' && steps.filter.outputs.any == 'true')
run: |
ls -ls /Applications/
ls -ls $ANDROID_SDK_ROOT/ndk
# ANDROID_SDK_ROOT may not be set on all runners
sudo xcode-select -switch /Applications/Xcode_${{ matrix.version }}.app

- name: Configure Environment
Expand Down
37 changes: 22 additions & 15 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ jobs:
"ubuntu-22.04-clang-14.0.0",
"ubuntu-22.04-emscripten-3.1",
"ubuntu-22.04-gcc-12.1.0",
"macos-13-xcode-14.2",
"macos-13-xcode-14.2-arm64",
"windows-2022-gcc-11",
"macos-15-intel-xcode-16.4",
"macos-15-xcode-16.4-arm64",
"windows-2022-msys2-clang-14",
"windows-2022-msvc-latest-x86",
"windows-2022-msvc-latest-x64",
"ubuntu-22.04-linter",
Expand Down Expand Up @@ -103,29 +103,29 @@ jobs:
lint: false
runCsTests: false
runTsTests: false
- name: macOS-13-xcode-14.2
os: macOS-13
- name: macos-15-intel-xcode-16.4
os: macos-15-intel
processor: x64
compiler: xcode
version: "14.2"
version: "16.4"
makeReleaseBuild: false
lint: false
runCsTests: true
runTsTests: false
- name: macOS-13-xcode-14.2-arm64
os: macOS-13
- name: macos-15-xcode-16.4-arm64
os: macos-15
processor: arm64
compiler: xcode
version: "14.2"
version: "16.4"
makeReleaseBuild: false
lint: false
runCsTests: false
runTsTests: false
- name: windows-2022-gcc-11
- name: windows-2022-msys2-clang-14
os: windows-2022
processor: x64
compiler: gcc
version: "11"
compiler: clang
version: "14"
makeReleaseBuild: false
lint: false
runCsTests: false
Expand Down Expand Up @@ -246,7 +246,7 @@ jobs:
if: (runner.os == 'macOS' && steps.filter.outputs.any == 'true')
run: |
ls -ls /Applications/
ls -ls $ANDROID_SDK_ROOT/ndk
# ANDROID_SDK_ROOT may not be set on all runners
sudo xcode-select -switch /Applications/Xcode_${{ matrix.version }}.app

- name: Update Environment (Windows MSYS2)
Expand All @@ -259,9 +259,9 @@ jobs:
base-devel
mingw-w64-clang-x86_64-gcc
mingw-w64-clang-x86_64-toolchain
mingw-w64-clang-x86_64-clang-14
mingw-w64-clang-x86_64-clang
mingw-w64-clang-x86_64-cmake
mingw-w64-clang-x86_64-llvm-14
mingw-w64-clang-x86_64-llvm
make
git

Expand Down Expand Up @@ -320,6 +320,13 @@ jobs:
if: (runner.os == 'Windows' && matrix.compiler == 'msvc' && steps.filter.outputs.cpp == 'true')
run: make test

- name: Run Tests (Windows MSYS2)
env:
PROCESSOR: ${{ matrix.processor }}
if: (runner.os == 'Windows' && matrix.compiler == 'clang' && steps.filter.outputs.cpp == 'true')
shell: msys2 {0}
run: make test-msys2

- name: Run Tests (Windows-x86)
env:
PROCESSOR: ${{ matrix.processor }}
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ jobs:

maccatalyst_build_arm64:
name: MacCatalyst Build (arm64)
runs-on: macos-13
runs-on: macos-15
env:
compiler_version: 14.2
compiler_version: 16.4
steps:
- name: Checkout Code
uses: actions/checkout@v4
Expand All @@ -82,9 +82,9 @@ jobs:

macos_build_arm64:
name: MacOS Build (arm64)
runs-on: macos-13
runs-on: macos-15
env:
compiler_version: 14.2
compiler_version: 16.4
steps:
- name: Checkout Code
uses: actions/checkout@v4
Expand All @@ -105,9 +105,9 @@ jobs:

macos_build_x64:
name: MacOS Build (x64)
runs-on: macos-13
runs-on: macos-15-intel
env:
compiler_version: 14.2
compiler_version: 16.4
steps:
- name: Checkout Code
uses: actions/checkout@v4
Expand Down Expand Up @@ -313,8 +313,8 @@ jobs:
name: ["windows-os"]
include:
# - name: macOS
# os: macOS-13
# version: "14.2"
# os: macos-26
# version: "26.2"
# osFolder: "maccatalyst"
- name: windows-os
os: windows-2022
Expand Down
63 changes: 48 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ EMSDK?=$(ELECTIONGUARD_CACHE)/emscripten
# not all platforms can compile all targets.
# valid values:
# OPERATING_SYSTEM: Android, Ios, Linux, Darwin, Windows
# OS_VARIANT: Debian, Alpine
# PROCESSOR: arm64, x64, x86
ifeq ($(OS),Windows_NT)
OPERATING_SYSTEM ?= Windows
Expand Down Expand Up @@ -114,18 +115,34 @@ ifeq ($(OPERATING_SYSTEM),Darwin)
endif
ifeq ($(OPERATING_SYSTEM),Linux)
@echo 🐧 LINUX INSTALL
sudo apt install -y build-essential
sudo apt install -y iwyu
sudo apt install -y llvm
sudo apt install -y clang-12
sudo apt install -y cmake
sudo apt install -y lcov
sudo apt install -y cppcheck
sudo apt install -y clang-format
sudo apt install -y clang-tidy
sudo apt install -y ninja-build
sudo apt install -y valgrind
sudo apt install -y unzip
if [ -f /etc/os-release ] && grep -qi "alpine" /etc/os-release; then \
echo "🏔️ Alpine Linux detected"; \
sudo apk update; \
echo "Installing CXX dependencies"; \
sudo apk add make musl-dev g++ cmake; \
echo "Installing DotNet dependencies"; \
sudo apk add dotnet10-sdk dotnetcore10-runtime; \
else \
echo "🐧 Debian-based Linux detected"; \
wget https://packages.microsoft.com/config/debian/12/packages-microsoft-prod.deb -O packages-microsoft-prod.deb; \
sudo dpkg -i packages-microsoft-prod.deb; \
rm packages-microsoft-prod.deb; \
sudo apt update; \
sudo apt install -y build-essential; \
sudo apt install -y iwyu; \
sudo apt install -y llvm; \
sudo apt install -y clang-14; \
sudo apt install -y cmake; \
sudo apt install -y lcov; \
sudo apt install -y cppcheck; \
sudo apt install -y clang-format; \
sudo apt install -y clang-tidy; \
sudo apt install -y ninja-build; \
sudo apt install -y valgrind; \
sudo apt install -y unzip; \
sudo apt install -y dotnet-sdk-10.0; \
sudo apt install -y npm; \
fi
endif
ifeq ($(OPERATING_SYSTEM),Windows)
@echo 🏁 WINDOWS INSTALL
Expand All @@ -134,11 +151,20 @@ ifeq ($(OPERATING_SYSTEM),Windows)
choco upgrade cmake -y
choco upgrade ninja -y
choco upgrade vswhere -y
choco upgrade llvm -y
choco install dotnet-sdk
endif
wget -O cmake/CPM.cmake https://github.com/cpm-cmake/CPM.cmake/releases/download/v0.38.2/CPM.cmake
make fetch-sample-data
dotnet tool restore

# environment-dotnet:
# ifeq ($(OPERATING_SYSTEM),Linux)
# # Ubuntu 22.04 and later?
# sudo add-apt-repository ppa:dotnet/backports
# apt-get update && sudo apt-get install -y dotnet-sdk-10.0
# endif

environment-msys2:
ifeq ($(OPERATING_SYSTEM),Windows)
@echo 🏁 MSYS2 INSTALL
Expand Down Expand Up @@ -187,6 +213,7 @@ ifeq ($(OPERATING_SYSTEM),Windows)
cmake -S . -B $(ELECTIONGUARD_BUILD_LIBS_DIR)/$(OPERATING_SYSTEM)/$(PROCESSOR)/$(TARGET) \
-G "Visual Studio 18" -A $(VSPLATFORM) \
-DCMAKE_BUILD_TYPE=$(TARGET) \
-DCMAKE_OBJECT_PATH_MAX=200 \
-DBUILD_SHARED_LIBS=ON \
-DDISABLE_VALE=$(TEMP_DISABLE_VALE) \
-DUSE_MSVC=ON \
Expand Down Expand Up @@ -307,7 +334,12 @@ build-cli:
build-ui:
@echo 🖥️ BUILD UI $(OPERATING_SYSTEM) $(PROCESSOR) $(TARGET)
cd ./src/electionguard-ui && dotnet restore
ifeq ($(OPERATING_SYSTEM),Darwin)
dotnet build -f net10.0-maccatalyst -c $(TARGET) ./$(ELECTIONGUARD_APP_ADMIN_DIR)/ElectionGuard.UI/ElectionGuard.UI.csproj /p:APPCENTER_SECRET_MACOS=$(APPCENTER_SECRET_MACOS)
endif
ifeq ($(OPERATING_SYSTEM),Windows)
dotnet build -c $(TARGET) ./src/electionguard-ui/ElectionGuard.UI.sln /p:Platform=$(PROCESSOR) /p:APPCENTER_SECRET_UWP=$(APPCENTER_SECRET_UWP) /p:APPCENTER_SECRET_MACOS=$(APPCENTER_SECRET_MACOS)
endif

build-wasm:
@echo 🌐 BUILD WASM $(OPERATING_SYSTEM) $(PROCESSOR) $(TARGET)
Expand Down Expand Up @@ -388,7 +420,7 @@ generate-interop:
# Lint / Format

format: build
cd $(ELECTIONGUARD_BUILD_LIBS_DIR)/$(PROCESSOR) && $(MAKE) format
cd $(ELECTIONGUARD_BUILD_LIBS_DIR)/$(OPERATING_SYSTEM)/$(PROCESSOR) && $(MAKE) format

lint:
dotnet jb inspectcode -o="lint-results.xml" -f="Xml" --build --verbosity="WARN" --severity="Warning" bindings/netstandard/ElectionGuard/ElectionGuard.sln
Expand Down Expand Up @@ -419,6 +451,7 @@ endif
ifeq ($(OPERATING_SYSTEM),Darwin)
dotnet publish -f net10.0-maccatalyst -c $(TARGET) /p:CreatePackage=true /p:ApplicationVersion=$(BUILD_NUMBER) /p:APPCENTER_SECRET_MACOS=$(APPCENTER_SECRET_MACOS) ./$(ELECTIONGUARD_APP_ADMIN_DIR)/ElectionGuard.UI/ElectionGuard.UI.csproj -o ./publish
endif
# add error for running on Linuxx!

publish-ui-appcenter:
@echo 🧱 PUBLISH UI APPCENTER
Expand All @@ -440,7 +473,7 @@ else
@echo "APPCENTER_SECRET_MACOS not set. Skipping AppCenter publish"
exit 1
endif

# add linux check
publish-wasm: build-npm
@echo 🌐 PUBLISH WASM
ifeq ($(OPERATING_SYSTEM),Windows)
Expand Down Expand Up @@ -728,7 +761,7 @@ fetch-sample-data:
@echo ⬇️ FETCH Sample Data
wget -O $(TEMPFILE) https://github.com/microsoft/electionguard/releases/download/v1.0/sample-data.zip
unzip -o $(TEMPFILE)
rm -f $(TEMPFILE)
# rm -f $(TEMPFILE)

generate-sample-data: build-netstandard
@echo Generate Sample Data
Expand Down
12 changes: 6 additions & 6 deletions cmake/tools.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
option(CODE_COVERAGE "Enable code coverage" OFF)
option(USE_STATIC_ANALYSIS "use static analysis tools" OFF)
option(USE_DYNAMIC_ANALYSIS "use dynamic analysis tools" OFF)
option(USE_FORMATTING "use formatting tools" OFF)
option(USE_FORMATTING "use formatting tools" ON)

function(use_valgrind TARGET_NAME)
set(VALGRIND_LOG ${PROJECT_BINARY_DIR}/valgrind.log)
Expand All @@ -20,7 +20,7 @@ function(use_valgrind TARGET_NAME)
endfunction()

# ---- Dependencies ----
include(cmake/CPM_0.31.0.cmake)
include(cmake/CPM.cmake)

CPMAddPackage(
NAME StableCoder-cmake-scripts
Expand Down Expand Up @@ -111,7 +111,7 @@ if(USE_DYNAMIC_ANALYSIS)
endif()
endif()

#if(USE_FORMATTING)
# message("++ Running with formatting")
# include(${StableCoder-cmake-scripts_SOURCE_DIR}/formatting.cmake)
#endif()
## if(USE_FORMATTING)
## message("++ Running with formatting")
## include(${StableCoder-cmake-scripts_SOURCE_DIR}/formatting.cmake)
## endif()
10 changes: 5 additions & 5 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.14...3.16 FATAL_ERROR)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../cmake")

# ---- Dependencies ----
include(../cmake/CPM_0.31.0.cmake)
include(../cmake/CPM.cmake)

CPMAddPackage(
NAME date
Expand Down Expand Up @@ -266,7 +266,7 @@ if(CODE_COVERAGE)
target_code_coverage(${META_PROJECT_TARGET} AUTO)
endif()

#if(USE_FORMATTING)
# message("++ Building with formatting")
# clang_format(format ${PROJECT_SOURCE_FILES})
#endif()
## if(USE_FORMATTING)
## message("++ Building with formatting")
## clang_format(format ${PROJECT_SOURCE_FILES})
## endif()
5 changes: 3 additions & 2 deletions src/electionguard-ui/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
<PackageVersion Include="Microsoft.AppCenter.Crashes" Version="5.0.2" />
<PackageVersion Include="Microsoft.AppCenter.Distribute" Version="5.0.2" />
<PackageVersion Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0" />
<PackageVersion Include="Microsoft.Maui.Controls" Version="9.0.40" />
<PackageVersion Include="Microsoft.Maui.Controls.Xaml" Version="9.0.40" />
<PackageVersion Include="Microsoft.Maui.Controls" Version="8.0.93" />
<PackageVersion Include="Microsoft.Maui.Core" Version="9.0.21" />
<PackageVersion Include="Microsoft.UI.Xaml" Version="2.8.6" />
<PackageVersion Include="MongoDB.Driver" Version="2.19.1" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
<PackageVersion Include="Shouldly" Version="4.1.0" />
Expand Down
Loading
Loading