-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Upgrade to .NET 8 * Upgrade to .NET 8 * Upgrade to use CAstFfi v2023.11.21 * Fix issues with using .NET 8 and latest version of CAstFfi * Update test c library build script * Update * Disable generating files * Fix failing unit tests * Fix test data * Fix test data * Fix test data * Don't include 64 bit enums in tests * Don't include 64 bit enums
- Loading branch information
1 parent
f3b5c20
commit d6033bb
Showing
73 changed files
with
292 additions
and
1,693 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,75 +1,12 @@ | ||
name: "main" | ||
name: "Main" | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- v* | ||
paths-ignore: | ||
- '**.md' | ||
workflow_dispatch: | ||
pull_request: | ||
branches: | ||
- main | ||
paths-ignore: | ||
- '**.md' | ||
types: [assigned, opened, synchronize, reopened] | ||
|
||
jobs: | ||
dotnet-job: | ||
name: ".NET" | ||
runs-on: ${{ matrix.platform.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
platform: | ||
- { name: Windows x64, os: windows-latest, shell: bash } | ||
- { name: Linux x64, os: ubuntu-latest, shell: bash } | ||
- { name: macOS x64, os: macos-latest, shell: bash } | ||
defaults: | ||
run: | ||
shell: ${{ matrix.platform.shell }} | ||
steps: | ||
|
||
- name: "Clone Git repository" | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: "Install Clang: Windows" | ||
if: matrix.platform.os == 'windows-latest' | ||
run: | | ||
source "${{ github.workspace }}\.github\scripts\install-clang-x64-windows.sh" | ||
- name: "Install Clang: Linux" | ||
if: matrix.platform.os == 'ubuntu-latest' | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install gcc-aarch64-linux-gnu llvm-14 clang-14 | ||
- name: "Install .NET" | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: '7.0.x' | ||
include-prerelease: true | ||
|
||
- name: "Install CAstFfi" | ||
shell: bash | ||
run: dotnet tool install --global bottlenoselabs.CAstFfi.Tool | ||
|
||
- name: ".NET" | ||
uses: bottlenoselabs/github-actions-dotnet@v3 | ||
with: | ||
dotnet-sdk-version: "7.0.x" | ||
solution-or-project: "${{ github.workspace }}/src/cs/C2CS.sln" | ||
is-enabled-upload-myget: "${{ matrix.platform.os == 'ubuntu-latest' && ( github.event_name == 'push' || startsWith(github.ref, 'refs/tags/v') ) }}" | ||
is-enabled-upload-nuget: "${{ matrix.platform.os == 'ubuntu-latest' && startsWith(github.ref, 'refs/tags/v') }}" | ||
myget-access-token: "${{ secrets.MYGET_ACCESS_TOKEN }}" | ||
nuget-access-token: "${{ secrets.NUGET_ACCESS_TOKEN }}" | ||
|
||
# - name: "Snipe test files" | ||
# uses: actions/upload-artifact@v3 | ||
# with: | ||
# name: "Test Data ${{ matrix.platform.name }}" | ||
# path: | | ||
# ${{ github.workspace }}/src/cs/tests/*Tests*/**/*.json | ||
|
||
test-job: | ||
name: "Test" | ||
uses: "./.github/workflows/test.yml" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
name: "Release" | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
pre-release: | ||
description: 'Is pre-release? (NOTE: Pre-releases are uploaded to MyGet.org instead of NuGet.org.)' | ||
required: true | ||
default: 'true' | ||
version: | ||
description: 'Version (NOTE: If left blank, the current date is used as the version.)' | ||
required: false | ||
default: '' | ||
|
||
jobs: | ||
|
||
test-job: | ||
name: "Test .NET solution" | ||
uses: "./.github/workflows/test.yml" | ||
|
||
release-job: | ||
name: "Release" | ||
needs: [test-job] | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
|
||
- name: "Clone Git repository" | ||
uses: actions/checkout@v3 | ||
|
||
- name: "Set version" | ||
id: set-version | ||
shell: bash | ||
run: | | ||
VERSION="${{ github.event.inputs.version }}" | ||
if [[ -z "$VERSION" ]]; then | ||
IS_PRERELEASE="${{ github.event.inputs.pre-release }}" | ||
if [[ "$IS_PRERELEASE" = "true" ]]; then | ||
VERSION="$(date +'%Y.%m.%d')-rc" | ||
else | ||
VERSION="$(date +'%Y.%m.%d')" | ||
fi | ||
fi | ||
echo "VERSION=$VERSION" | ||
echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT" | ||
- name: ".NET pack" | ||
run: dotnet pack "./src/cs" --nologo --verbosity minimal --configuration Release -p:PackageVersion="${{ steps.set-version.outputs.VERSION }}" -p:RepositoryBranch="${{ github.head_ref || github.ref_name }}" -p:RepositoryCommit="${{ github.sha }}" | ||
|
||
- name: "Upload packages to MyGet" | ||
if: github.event_name == 'workflow_dispatch' && github.event.inputs.pre-release == 'true' | ||
env: | ||
MYGET_ACCESS_TOKEN: ${{ secrets.MYGET_ACCESS_TOKEN }} | ||
run: dotnet nuget push "./nupkg/**/*.nupkg" --source https://www.myget.org/F/bottlenoselabs/api/v3/index.json --skip-duplicate --api-key $MYGET_ACCESS_TOKEN | ||
|
||
- name: "Upload packages to NuGet" | ||
if: github.event_name == 'schedule' || github.event.inputs.pre-release == 'false' | ||
env: | ||
NUGET_ACCESS_TOKEN: ${{ secrets.NUGET_ACCESS_TOKEN }} | ||
run: dotnet nuget push "./nupkg/**/*.nupkg" --source https://api.nuget.org/v3/index.json --skip-duplicate --api-key $NUGET_ACCESS_TOKEN | ||
|
||
- name: "Create tag and GitHub release" | ||
uses: softprops/action-gh-release@v1 | ||
if: github.event_name == 'schedule' || github.event.inputs.pre-release == 'false' | ||
with: | ||
generate_release_notes: true | ||
prerelease: "{{ github.event.inputs.pre-release == 'true' }}" | ||
tag_name: "v${{ steps.set-version.outputs.VERSION }}" | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: "Test .NET solution" | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
|
||
test-dotnet-job: | ||
name: "Test .NET solution: ${{ matrix.platform.name }}" | ||
runs-on: ${{ matrix.platform.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
platform: | ||
- { name: Windows, os: windows-latest } | ||
- { name: Linux, os: ubuntu-latest } | ||
- { name: macOS, os: macos-latest } | ||
defaults: | ||
run: | ||
shell: bash | ||
steps: | ||
|
||
- name: "Clone Git repository" | ||
uses: actions/checkout@v3 | ||
|
||
- name: "Install Clang: Windows" | ||
if: matrix.platform.os == 'windows-latest' | ||
run: | | ||
source "${{ github.workspace }}\.github\scripts\install-clang-x64-windows.sh" | ||
- name: "Install Clang: Linux" | ||
if: matrix.platform.os == 'ubuntu-latest' | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install gcc-i686-linux-gnu gcc-x86-64-linux-gnu gcc-aarch64-linux-gnu llvm-14 clang-14 | ||
- name: "Setup .NET" | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: '8.x' | ||
|
||
- name: "Install CAstFfi" | ||
shell: bash | ||
run: dotnet tool install --global bottlenoselabs.CAstFfi.Tool | ||
|
||
- name: "Test .NET solution" | ||
run: | | ||
dotnet test '${{ github.workspace }}/src/cs' --nologo --verbosity minimal --configuration Release | ||
- name: "Collect generated test files" | ||
uses: actions/upload-artifact@v3 | ||
if: github.event_name == 'pull_request' | ||
with: | ||
name: "Test Data ${{ matrix.platform.name }}" | ||
path: | | ||
${{ github.workspace }}/src/cs/tests/*.Tests/Data/Values/**/*.json |
This file was deleted.
Oops, something went wrong.
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
#!/bin/bash | ||
DIRECTORY="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" | ||
OUPUT_DIRECTORY=$DIRECTORY/bin | ||
|
||
rm -rf ./cmake-build-release | ||
cmake -S . -B cmake-build-release -DCMAKE_BUILD_TYPE=Release -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY=/Users/lstranks/Programming/bottlenoselabs/c2cs/bin/C2CS.Tests/Debug/net7.0/c/tests/_container_library/bin -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/Users/lstranks/Programming/bottlenoselabs/c2cs/bin/C2CS.Tests/Debug/net7.0/c/tests/_container_library/bin -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=/Users/lstranks/Programming/bottlenoselabs/c2cs/bin/C2CS.Tests/Debug/net7.0/c/tests/_container_library/bin -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE=/Users/lstranks/Programming/bottlenoselabs/c2cs/bin/C2CS.Tests/Debug/net7.0/c/tests/_container_library/bin | ||
rm -rf $DIRECTORY/cmake-build-release | ||
cmake -S $DIRECTORY -B cmake-build-release -DCMAKE_BUILD_TYPE=Release -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY=$OUPUT_DIRECTORY -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=$OUPUT_DIRECTORY -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE=$OUPUT_DIRECTORY | ||
cmake --build cmake-build-release --config Release | ||
rm -rf ./cmake-build-release | ||
rm -rf $DIRECTORY/cmake-build-release |
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
This file was deleted.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.