Skip to content

Commit

Permalink
chore(ci): fix runners for macos (#444)
Browse files Browse the repository at this point in the history
  • Loading branch information
everpcpc committed Jul 3, 2024
1 parent 7658a59 commit fbb976e
Show file tree
Hide file tree
Showing 3 changed files with 168 additions and 130 deletions.
21 changes: 7 additions & 14 deletions .github/workflows/bindings.nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ on:
branches:
- main
paths:
- 'sql/**'
- 'bindings/nodejs/**'
- "sql/**"
- "bindings/nodejs/**"
- ".github/workflows/bindings.nodejs.yml"

concurrency:
Expand All @@ -30,7 +30,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: '18'
node-version: "18"
- name: Corepack
working-directory: bindings/nodejs
run: corepack enable
Expand Down Expand Up @@ -60,8 +60,8 @@ jobs:
- { target: aarch64-unknown-linux-musl, runner: ubuntu-latest }
- { target: x86_64-unknown-linux-musl, runner: ubuntu-latest }
- { target: x86_64-pc-windows-msvc, runner: windows-2019 }
- { target: x86_64-apple-darwin, runner: macos-11 }
- { target: aarch64-apple-darwin, runner: macos-11 }
- { target: x86_64-apple-darwin, runner: macos-13 }
- { target: aarch64-apple-darwin, runner: macos-14 }
steps:
- uses: actions/checkout@v4
- name: Setup Rust toolchain
Expand All @@ -72,7 +72,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: '18'
node-version: "18"
- name: Install ziglang
uses: goto-bus-stop/setup-zig@v2
with:
Expand All @@ -87,13 +87,6 @@ jobs:
working-directory: bindings/nodejs
shell: bash
run: |
if [[ "${{ matrix.target }}" == 'aarch64-apple-darwin' ]]; then
sudo rm -Rf /Library/Developer/CommandLineTools/SDKs/*
export CC=$(xcrun -f clang)
export CXX=$(xcrun -f clang++)
SYSROOT=$(xcrun --sdk macosx --show-sdk-path)
export CFLAGS="-isysroot $SYSROOT -isystem $SYSROOT"
fi
export NAPI_TARGET=${{ matrix.target }}
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
yarn build:debug
Expand Down Expand Up @@ -125,7 +118,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: '18'
node-version: "18"
- name: Corepack
working-directory: bindings/nodejs
run: corepack enable
Expand Down
85 changes: 61 additions & 24 deletions .github/workflows/bindings.python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,54 +10,61 @@ on:
branches:
- main
paths:
- 'sql/**'
- 'bindings/python/**'
- "sql/**"
- "bindings/python/**"
- ".github/workflows/bindings.python.yml"

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

jobs:
integration:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: ./.github/actions/setup
with:
cache-key: bindings-python-integration
cache-key: bindings-python-check
- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pipenv'
cache-dependency-path: 'bindings/python/Pipfile.lock'
- name: Install pipenv
run: curl https://raw.githubusercontent.com/pypa/pipenv/master/get-pipenv.py | python
python-version: "3.11"
- name: Install dependencies
working-directory: bindings/python
run: pipenv install --dev
run: pip install ruff
- name: Check format
working-directory: bindings/python
run: pipenv run ruff format --check .
- name: Setup develop
working-directory: bindings/python
run: pipenv run maturin develop
- name: Test
run: make -C tests test-bindings-python
run: ruff format --check .

build:
name: build-${{ matrix.os }}-${{ matrix.arch }}
needs: check
runs-on: ${{ matrix.runner }}
strategy:
matrix:
include:
- { os: linux, arch: x86_64, target: x86_64-unknown-linux-gnu, runner: ubuntu-latest }
- { os: linux, arch: aarch64, target: aarch64-unknown-linux-gnu, runner: ubuntu-latest }
- { os: windows, arch: x86_64, target: x86_64-pc-windows-msvc, runner: windows-2019 }
- { os: macos, arch: x86_64, target: x86_64-apple-darwin, runner: macos-11 }
- { os: macos, arch: aarch64, target: aarch64-apple-darwin, runner: macos-11 }
- os: linux
arch: x86_64
target: x86_64-unknown-linux-gnu
runner: ubuntu-latest
- os: linux
arch: aarch64
target: aarch64-unknown-linux-gnu
runner: ubuntu-latest
- os: windows
arch: x86_64
target: x86_64-pc-windows-msvc
runner: windows-2019
- os: macos
arch: x86_64
target: x86_64-apple-darwin
runner: macos-13
- os: macos
arch: aarch64
target: aarch64-apple-darwin
runner: macos-14
steps:
- uses: actions/checkout@v4
- name: Get opts
Expand Down Expand Up @@ -85,17 +92,47 @@ jobs:
working-directory: bindings/python
target: ${{ matrix.target }}
manylinux: ${{ steps.opts.outputs.MANYLINUX }}
sccache: 'true'
sccache: "true"
args: ${{ steps.opts.outputs.BUILD_ARGS }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: bindings-python-${{ matrix.os }}-${{ matrix.arch }}
path: bindings/python/dist/*.whl

integration:
name: integration-${{ matrix.pyver }}
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
pyver: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.pyver }}
- name: Prepare
working-directory: tests
run: make up
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: bindings-python-linux-x86_64
path: bindings/python/artifacts
- name: Install dependencies
working-directory: bindings/python
run: |
pip install behave
pip install artifacts/*.whl
- name: Test
working-directory: bindings/python
run: behave tests/*

publish:
if: startsWith(github.ref, 'refs/tags/v')
needs: [build, integration]
needs: [check, build, integration]
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down
Loading

0 comments on commit fbb976e

Please sign in to comment.