Skip to content

Commit

Permalink
Configured macOS environment for arm64 architecture
Browse files Browse the repository at this point in the history
  • Loading branch information
olszomal committed Nov 4, 2024
1 parent 2a6a8ac commit 4a58fba
Showing 1 changed file with 31 additions and 14 deletions.
45 changes: 31 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
generator: Unix Makefiles
vcpkg_root:
- id: macOS
triplet: x64-osx
triplet: arm64-osx
compiler: clang
os: macOS-latest
generator: Unix Makefiles
Expand Down Expand Up @@ -114,10 +114,17 @@ jobs:
sudo apt-get remove needrestart || echo Ignored
sudo apt-get install -y libssl-dev zlib1g-dev python3-cryptography
- name: Set up Python (macOS)
if: runner.os == 'macOS'
uses: actions/setup-python@v4
with:
python-version: '3.13'
architecture: 'arm64'

- name: Set up Python virtual environment (macOS)
if: runner.os == 'macOS'
run: |
python -m venv venv
python -m venv --system-site-packages --copies venv
echo "VIRTUAL_ENV=${{github.workspace}}/venv" >> $GITHUB_ENV
echo "${{github.workspace}}/venv/bin" >> $GITHUB_PATH
Expand All @@ -131,13 +138,21 @@ jobs:
if: runner.os == 'macOS'
uses: jwlawson/actions-setup-cmake@v2.0
with:
cmake-version: '3.17.0'
cmake-version: '3.20.0'

- name: Install python3 cryptography module (macOS)
if: runner.os == 'macOS'
run: |
pip install --upgrade pip
pip install cryptography
source venv/bin/activate
python -m pip install --upgrade pip
ARCHFLAGS="-arch arm64" python -m pip install --no-binary :all: cryptography
- name: Install python3 cryptography module (Windows)
if: runner.os == 'Windows'
run: |
python.exe -m ensurepip
python.exe -m pip install --upgrade pip
python.exe -m pip install cryptography
- name: Find the latest version of Python (Windows)
if: runner.os == 'Windows'
Expand All @@ -156,13 +171,6 @@ jobs:
exit 1
}
- name: Install python3 cryptography module (Windows)
if: runner.os == 'Windows'
run: |
python.exe -m ensurepip
python.exe -m pip install --upgrade pip
python.exe -m pip install cryptography
- name: Configure CMake
run: cmake
-G "${{matrix.generator}}"
Expand All @@ -172,6 +180,7 @@ jobs:
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
-DCMAKE_INSTALL_PREFIX=${{github.workspace}}/dist
-DVCPKG_TARGET_TRIPLET=${{matrix.triplet}}
-DPython3_EXECUTABLE="${{ github.workspace }}/venv/bin/python"

- name: Build
run: cmake
Expand All @@ -182,8 +191,9 @@ jobs:
working-directory: ${{github.workspace}}/build
if: runner.os == 'macOS'
run: |
python --version
source venv/bin/activate
python -c "import sys; print(sys.executable)"
python --version
python -c "import cryptography; print(f'Python3 cryptography version {cryptography.__version__}')"
- name: List files (Linux/macOS)
Expand All @@ -194,7 +204,14 @@ jobs:
if: runner.os == 'Windows'
run: Get-ChildItem -Recurse -Name ..

- name: Test
- name: Test (macOS)
if: runner.os == 'macOS'
working-directory: ${{github.workspace}}/build
run: |
source ../venv/bin/activate
ctest -C ${{env.BUILD_TYPE}}
- name: Test (non-macOS)
working-directory: ${{github.workspace}}/build
run: ctest -C ${{env.BUILD_TYPE}}

Expand Down

0 comments on commit 4a58fba

Please sign in to comment.