fix CI #80
Workflow file for this run
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: .NET | |
on: [push, pull_request] | |
jobs: | |
# generate-matrix: | |
# # needs: execute-linter | |
# name: Generate Job Matrix | |
# if: github.ref == 'refs/heads/master' | |
# runs-on: ubuntu-latest | |
# outputs: | |
# matrix: ${{ steps.set-matrix.outputs.matrix }} | |
# steps: | |
# - name: Generate Job Matrix | |
# id: set-matrix | |
# env: | |
# MATRIX: '{"config": [ | |
# {"name": "Linux x86_64 GCC 14","compiler": "GCC","version": "14","os": "ubuntu-20.04","docker_suffix": "-ubuntu20.04", "os_kind": "linux"}, | |
# {"name": "macOS - arm64 - apple-clang 15","compiler": "apple-clang","version": "15","os": "macos-14", "os_kind": "macos"} | |
# ]}' | |
# run: | | |
# echo "${MATRIX}" | |
# echo "matrix=${MATRIX}" >> $GITHUB_OUTPUT | |
generate-matrix: | |
name: Generate Job Matrix | |
# if: github.ref == 'refs/heads/master' | |
runs-on: ubuntu-latest | |
outputs: | |
matrix: ${{ steps.set-matrix.outputs.matrix }} | |
steps: | |
- name: Generate Job Matrix | |
id: set-matrix | |
env: | |
MATRIX: '{"config": [ | |
{"name": "macOS 14 (ARM) - NodeJS 20","nodejs_version": "20","os": "macos-14","os_kind": "macos","test": "0"} | |
]}' | |
run: | | |
echo "${MATRIX}" | |
echo "matrix=${MATRIX}" >> $GITHUB_OUTPUT | |
builds: | |
needs: generate-matrix | |
runs-on: ${{ matrix.config.os }} | |
strategy: | |
fail-fast: false | |
matrix: ${{fromJson(needs.generate-matrix.outputs.matrix)}} | |
name: ${{ matrix.config.name }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Fetch history | |
# run: git fetch --prune --unshallow | |
run: git fetch --unshallow | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
# dotnet-version: 3.1.x | |
# dotnet-version: 5.0.x | |
# dotnet-version: 6.0.x | |
dotnet-version: 8.0.x | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
# - "python --version" | |
# - python -m pip install --upgrade pip | |
# - "%PYTHON%/Scripts/pip.exe install kthbuild --upgrade" | |
- name: Install Dependencies (Unix) | |
run: | | |
python --version | |
cmake --version | |
pip install --upgrade pip | |
pip install kthbuild --upgrade | |
conan --version | |
pip install conan --upgrade | |
conan --version | |
shell: bash | |
- name: Pre-Compile | |
run: | | |
conan config install https://github.com/k-nuth/ci-utils/raw/master/conan/config2023.zip | |
conan config install https://github.com/k-nuth/ci-utils/raw/master/conan/config2023.zip | |
conan remote add kth https://packages.kth.cash/api | |
conan profile list | |
conan profile detect | |
conan profile list | |
conan install --requires=c-api/0.48.0 --update -o c-api/*:shared=True -s compiler.cppstd=20 | |
shell: bash | |
- name: Compile | |
run: ./build.sh Compile | |
shell: bash | |
- name: Test | |
run: | | |
pwd | |
find . -name "*kth-c-api*" | |
./build.sh Test | |
shell: bash | |
- name: Pack | |
run: ./build.sh Pack | |
shell: bash | |
- name: Push | |
if: ${{ matrix.config.os_kind == 'macos' }} | |
env: | |
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} | |
GHA_COMMIT_MSG: ${{ github.event.head_commit.message }} | |
PUBLISH_TO_NUGET: "true" | |
run: | | |
# Write-Host "NUGET_API_KEY: $Env:NUGET_API_KEY" | |
# Write-Host "GHA_COMMIT_MSG: $Env:GHA_COMMIT_MSG" | |
echo "NUGET_API_KEY: ${NUGET_API_KEY}" | |
echo "GHA_COMMIT_MSG: ${GHA_COMMIT_MSG}" | |
# $Env:GHA_BRANCH = "${{ github.ref }}".Split("/")[2] | |
# Write-Host "My branch name is $Env:GHA_BRANCH" | |
# ./build.sh Push --NugetApiUrl "https://api.nuget.org/v3/index.json" --NugetApiKey $env:NUGET_API_KEY | |
export GHA_BRANCH=$(echo '${{ github.ref }}' | awk -F '/' '{print $3}') | |
echo "My branch name is $GHA_BRANCH" | |
./build.sh Push --NugetApiUrl "https://api.nuget.org/v3/index.json" --NugetApiKey $NUGET_API_KEY | |
shell: bash | |
# - name: Restore dependencies | |
# run: dotnet restore | |
# - name: Build | |
# run: dotnet build --no-restore | |
# - name: Test | |
# run: dotnet test --no-build --verbosity normal |