Skip to content

Commit

Permalink
Tentative fix for osx github action (#5)
Browse files Browse the repository at this point in the history
Fixes GitHub action osx and updates the others
  • Loading branch information
allanleal committed Oct 24, 2024
1 parent bea5471 commit 7229659
Show file tree
Hide file tree
Showing 6 changed files with 120 additions and 92 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/bazel.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
name: bazel

disabled: true

on:
push:
branches:
Expand Down Expand Up @@ -51,4 +53,4 @@ jobs:
shell: bash -l {0}
run: |
bazel test //examples/forward:all --test_output=all
bazel test //examples/reverse:all --test_output=all
bazel test //examples/reverse:all --test_output=all
91 changes: 53 additions & 38 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,56 +10,71 @@ on:
schedule:
- cron: "0 5 * * 1" # runs at 05:00 UTC on Mondays

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:

runs-on: ubuntu-latest

env:
os: Linux-x86_64
configuration: Release

name: ${{ matrix.config }} build on ${{ matrix.os }} (Python ${{ matrix.python-version }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
max-parallel: 4
matrix:
os: ["ubuntu-latest"]
python-version: [3.11]
config: ["Release"]

steps:
- uses: actions/checkout@v1
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
- name: Configure
shell: bash -l {0}
- uses: actions/checkout@v3

- name: Timestamp # Idea from https://tinyurl.com/47wz7vpv
id: timestamp
shell: cmake -P {0}
run: |
conda config --set always_yes yes --set changeps1 no
conda config --add channels conda-forge
conda install conda-devenv
conda devenv
source activate autodiff
cmake -S . -B .build -DCMAKE_BUILD_TYPE=${{ env.configuration }} -DAUTODIFF_TEST_SANITIZE=ON
- name: Cache
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
message("::set-output name=now::${current_date}")
- name: Configuring Cache
id: cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: $HOME/.ccache
key: ${{ runner.os }}-ccache

- name: Configuring Miniconda
uses: conda-incubator/setup-miniconda@v3
with:
path: ~/.ccache
key: ${{ runner.os }}-ccache-${{ hashFiles('hashFile.txt') }} # https://github.community/t/caching-for-c-builds/124529/2
restore-keys: ${{ runner.os }}-ccache-
- name: Build
shell: bash -l {0}
python-version: ${{ matrix.python-version }}
miniforge-version: latest

- name: Checking Miniconda Environment
shell: bash -el {0}
run: |
conda info
conda list
conda config --show-sources
conda config --show
printenv | sort
- name: Configuring Conda Environment
shell: bash -el {0}
env:
PYTHON_VERSION: ${{ matrix.python-version }}
run: |
mamba install conda-devenv
conda devenv -e mamba
- name: Building, Testing & Installing
shell: bash -el {0}
run: |
source activate autodiff
ccache -s
ccache -z
cmake --build .build --parallel 3
mkdir -p .build && cd .build
cmake -GNinja .. -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DAUTODIFF_TEST_SANITIZE=ON
ninja
ninja tests
ninja install
ccache -s
- name: Install
shell: bash -l {0}
run: |
source activate autodiff
cmake --build .build --target install
- name: Tests
shell: bash -l {0}
run: |
source activate autodiff
cmake -S . -B .build -DCMAKE_BUILD_TYPE=Debug
cmake --build .build --target tests --parallel 3
89 changes: 49 additions & 40 deletions .github/workflows/osx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,62 +10,71 @@ on:
schedule:
- cron: "0 5 * * 1" # runs at 05:00 UTC on Mondays

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:

runs-on: macOS-latest

env:
os: MacOSX-x86_64
configuration: Release

name: ${{ matrix.config }} build on ${{ matrix.os }} (Python ${{ matrix.python-version }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
max-parallel: 4
matrix:
os: ["macos-latest"]
python-version: [3.11]
config: ["Release"]

steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: actions/checkout@v3

- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true

- name: Conda Environment
shell: bash -l {0}
- name: Timestamp # Idea from https://tinyurl.com/47wz7vpv
id: timestamp
shell: cmake -P {0}
run: |
conda config --set always_yes yes --set changeps1 no
conda config --add channels conda-forge
conda install conda-devenv
conda devenv
- name: Cache
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
message("::set-output name=now::${current_date}")
- name: Configuring Cache
id: cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: $HOME/.ccache
key: ${{ runner.os }}-ccache
- name: Configure
shell: bash -l {0}

- name: Configuring Miniconda
uses: conda-incubator/setup-miniconda@v3
with:
python-version: ${{ matrix.python-version }}
miniforge-version: latest

- name: Checking Miniconda Environment
shell: bash -el {0}
run: |
source activate autodiff
cmake -S . -B .build -DCMAKE_BUILD_TYPE=${{ env.configuration }} -DAUTODIFF_TEST_SANITIZE=ON
- name: Build
shell: bash -l {0}
conda info
conda list
conda config --show-sources
conda config --show
printenv | sort
- name: Configuring Conda Environment
shell: bash -el {0}
env:
PYTHON_VERSION: ${{ matrix.python-version }}
run: |
mamba install conda-devenv
conda devenv -e mamba
- name: Building, Testing & Installing
shell: bash -el {0}
run: |
source activate autodiff
ccache -s
ccache -z
cmake --build .build --parallel 3
mkdir -p .build && cd .build
cmake -GNinja .. -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DAUTODIFF_TEST_SANITIZE=ON
ninja
ninja tests
ninja install
ccache -s
- name: Install
shell: bash -l {0}
run: |
source activate autodiff
cmake --build .build --target install
- name: Test
shell: bash -l {0}
run: |
source activate autodiff
cmake -S . -B .build -DCMAKE_BUILD_TYPE=Debug
cmake --build .build --target tests --parallel 3
16 changes: 8 additions & 8 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
submodules: recursive

- uses: conda-incubator/setup-miniconda@v2
- uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true

- name: Conda Environment
shell: bash -l {0}

- name: Configuring Conda Environment
shell: bash -el {0}
run: |
conda config --set always_yes yes --set changeps1 no
conda config --add channels conda-forge
conda install conda-devenv
conda devenv
mamba install conda-devenv
conda devenv -e mamba
- name: Build Website
shell: bash -l {0}
run: |
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
jobs:
build:

# runs-on: windows-latest # Getting "fatal error C1001: Internal compiler error." for some examples in windows with MSVC 2022
# runs-on: windows-latest # Getting "fatal error C1001: Internal compiler error." for some examples in windows with MSVC 2022
runs-on: windows-2019

env:
Expand All @@ -24,11 +24,11 @@ jobs:
max-parallel: 4

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
submodules: recursive

- uses: conda-incubator/setup-miniconda@v2
- uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
auto-activate-base: true
Expand All @@ -42,7 +42,7 @@ jobs:
conda devenv
- name: Cache
id: cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: $HOME\clcache
key: ${{ runner.os }}-clcache
Expand Down
4 changes: 3 additions & 1 deletion environment.devenv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ channels:
dependencies:
- catch2>=3
- ccache
- clangxx_osx-64 # [osx]
- clangxx # [linux]
- clangxx_osx-64 # [osx and not arm64]
- clangxx_osx-arm64 # [osx and arm64]
- cmake
- doxygen=1.9.1 # [linux]
- eigen
Expand Down

0 comments on commit 7229659

Please sign in to comment.