Skip to content

Commit

Permalink
Ci Runners for Mac Intel & Windows (#1162)
Browse files Browse the repository at this point in the history
* add mac intel and try windows runner

* windows build

* windows ci

* windows ci

* windows ci

* windows ci

* windows ci

* windows ci

* windows ci

* windows ci

* windows ci

* windows ci

* Update ci.yml

* Update ci.yml

* Update ci.yml

* Update ci.yml

* Update ci.yml

* Update ci.yml

* Update ci.yml

* Update ci.yml

* Update ci.yml

* Update ci.yml

* Update ci.yml

* Update ci.yml

* Update ci.yml

* Update ci.yml

* Update ci.yml

* Update ci.yml

* Update ci.yml

* Update ci.yml

* Update ci.yml

* fix deprecation warnings in ci.yml

* Update ci.yml

* Update ci.yml

* Update ci.yml

* python avail check for windbosse
  • Loading branch information
dguittet committed May 9, 2024
1 parent 005b77b commit 5e4136d
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 7 deletions.
92 changes: 85 additions & 7 deletions .github/workflows/ci.yml
Expand Up @@ -14,7 +14,7 @@ jobs:

steps:
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v1.12
uses: jwlawson/actions-setup-cmake@v2
with:
cmake-version: '3.24.x'
- name: Test cmake version
Expand Down Expand Up @@ -68,19 +68,22 @@ jobs:
${SSCDIR}/build/test/Test
- name: Upload Artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: SSC Linux Shared Libraries
path: |
${{env.SSCDIR}}/build/ssc/libssc.so
${{env.SSCDIR}}/build/ssc/ssc.so
build-on-mac:
runs-on: macos-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-14-large, macos-latest]

steps:
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v1.12
uses: jwlawson/actions-setup-cmake@v2
with:
cmake-version: '3.24.x'
- name: Test cmake version
Expand Down Expand Up @@ -124,7 +127,7 @@ jobs:
# Build your program with the given configuration
run: |
cd ${SSCDIR}/build
make -j4
make -j3
- name: Test
# Turn off fast fail for when the landbosse tests write to cerr
Expand All @@ -134,10 +137,85 @@ jobs:
shell: bash

- name: Upload Artifacts
uses: actions/upload-artifact@v3
if: ${{ matrix.os == 'macos-latest' }}
uses: actions/upload-artifact@v4
with:
name: SSC Mac Arm Shared Libraries
path: |
${{env.SSCDIR}}/build/ssc/libssc.dylib
${{env.SSCDIR}}/build/ssc/ssc.dylib
- name: Upload Artifacts
if: ${{ matrix.os != 'macos-latest' }}
uses: actions/upload-artifact@v4
with:
name: SSC Mac Shared Libraries
name: SSC Mac Intel Shared Libraries
path: |
${{env.SSCDIR}}/build/ssc/libssc.dylib
${{env.SSCDIR}}/build/ssc/ssc.dylib
build-on-windows:
runs-on: windows-2019

steps:
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v1.12
with:
cmake-version: '3.24.x'
- name: Test cmake version
run: cmake --version

- name: Set relative paths
shell: bash
run: |
GTEST=$GITHUB_WORKSPACE/googletest
echo "GTEST=$GTEST" >> $GITHUB_ENV
SSCDIR=$GITHUB_WORKSPACE/ssc
echo "SSCDIR=$SSCDIR" >> $GITHUB_ENV
- name: Clone Gtest
uses: actions/checkout@v2
with:
repository: google/googletest
path: googletest
ref: b85864c64758dec007208e56af933fc3f52044ee

- name: build Gtest
shell: bash
# Need to build both Release and Debug for the SSC CMake below
run: |
export
mkdir ${GTEST}/build
cd ${GTEST}/build
cmake -Dgtest_force_shared_crt=ON ..
cmake --build . --config Release -j4
cmake --build . --config Debug -j4
- name: Checkout SSC
uses: actions/checkout@v2
with:
path: ssc

- name: Configure CMake
shell: bash
# Configure cmake to build ssc tests but not tools
run: |
mkdir ${SSCDIR}/build
cd ${SSCDIR}/build
cmake .. -DSAM_SKIP_TOOLS=1
cmake --build . --config Release -j4
cp ssc/Release/* test/Release
- name: Test
shell: bash
# Turn off fast fail for when the landbosse tests write to cerr
run: |
cd ${SSCDIR}/build/test/Release
./Test.exe
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: SSC Windows Shared Libraries
path: |
${{env.SSCDIR}}\build\ssc\Release\ssc.dll
4 changes: 4 additions & 0 deletions test/ssc_test/cmod_windpower_test.cpp
Expand Up @@ -541,6 +541,10 @@ TEST(Turbine_powercurve_cmod_windpower_eqns, Case4) {
}

bool setup_python() {
if (!std::getenv("SAMNTDIR")){
std::cerr << "Python not configured.";
return false;
}
#ifdef __WINDOWS__
auto python_dir = std::string(std::getenv("SAMNTDIR")) + "\\deploy\\runtime\\python\\";
#else
Expand Down

0 comments on commit 5e4136d

Please sign in to comment.