summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2021-12-02 18:41:11 +0800
committerPaul Kehrer <paul.l.kehrer@gmail.com>2021-12-03 19:58:50 +0800
commit328b66612533b1f4daf559e792f90e917caf83d7 (patch)
tree0f16e542a3d96732eedfa734798688e86de7871e
parent44f9703906d118cf689ce964cd310445e44b8853 (diff)
downloadcryptography-macos.tar.gz
add macos arm64 self-hosted CImacos
-rw-r--r--.github/workflows/macarm64.yml69
-rw-r--r--tox.ini8
2 files changed, 77 insertions, 0 deletions
diff --git a/.github/workflows/macarm64.yml b/.github/workflows/macarm64.yml
new file mode 100644
index 000000000..bd7a864cd
--- /dev/null
+++ b/.github/workflows/macarm64.yml
@@ -0,0 +1,69 @@
+name: macOS arm64 CI
+on:
+ push:
+ branches:
+ - main
+ - '*.*.x'
+ tags:
+ - '*.*'
+ - '*.*.*'
+
+permissions: read-all
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
+ cancel-in-progress: true
+
+jobs:
+ macos-arm64:
+ if: github.repository_owner == 'pyca'
+ runs-on: [self-hosted, macos, ARM64]
+ name: "macOS arm64"
+ strategy:
+ fail-fast: false
+ matrix:
+ PYTHON:
+ - {TOXENV: "py310", BIN_PATH: '/Library/Frameworks/Python.framework/Versions/3.10/bin/python3'}
+ timeout-minutes: 10
+ steps:
+ - name: "Delete workspace" # self-hosted runners need this, sigh
+ run: gfind ! -name '.' ! -name '..' -delete
+ - uses: actions/checkout@v2.4.0
+ with:
+ persist-credentials: false
+ - uses: actions/cache@v2.1.7
+ with:
+ path: |
+ ~/.cargo/bin/
+ ~/.cargo/registry/index/
+ ~/.cargo/registry/cache/
+ ~/.cargo/git/db/
+ src/rust/target/
+ key: ${{ runner.os }}-${{ matrix.PYTHON.TOXENV }}-cargo-macarm64-${{ hashFiles('**/Cargo.lock') }}
+
+ - uses: actions/checkout@v2.4.0
+ with:
+ repository: "google/wycheproof"
+ path: "wycheproof"
+ ref: "master"
+ - name: Setup venv and install deps
+ run: |
+ arch -arm64 $BIN_PATH -m venv venv
+ arch -arm64 venv/bin/python -m pip install tox requests
+ env:
+ BIN_PATH: ${{ matrix.PYTHON.BIN_PATH }}
+ - name: Download OpenSSL
+ run: |
+ arch -arm64 venv/bin/python .github/workflows/download_openssl.py macos openssl-macos-universal2
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ - name: Tests
+ run: |
+ CRYPTOGRAPHY_SUPPRESS_LINK_FLAGS=1 \
+ LDFLAGS="${HOME}/openssl-macos-universal2/lib/libcrypto.a ${HOME}/openssl-macos-universal2/lib/libssl.a" \
+ CFLAGS="-I${HOME}/openssl-macos-universal2/include -Werror -Wno-error=deprecated-declarations -Wno-error=incompatible-pointer-types-discards-qualifiers -Wno-error=unused-function -Wno-error=unused-command-line-argument $EXTRA_CFLAGS" \
+ arch -arm64 venv/bin/tox -r -- --color=yes --wycheproof-root=wycheproof
+ env:
+ TOXENV: ${{ matrix.PYTHON.TOXENV }}
+ ARCHFLAGS: '-arch arm64'
+ CARGO_TARGET_DIR: ${{ format('{0}/src/rust/target/', github.workspace) }}
diff --git a/tox.ini b/tox.ini
index 8484b833f..69ff5df1f 100644
--- a/tox.ini
+++ b/tox.ini
@@ -23,6 +23,14 @@ commands =
pip list
pytest -n auto --durations=10 {posargs} tests/
+# Temp coverage disable for macOS arm64 because CTracer isn't compiling
+# probably due to the crazy rosetta arch -arm64 shenanigans
+[testenv:macos-nocoverage]
+basepython = python3
+commands =
+ pip list
+ pytest -n auto --durations=10 {posargs} tests/
+
[testenv:docs]
extras =
docs