Skip to content

Commit

Permalink
✅ Fix pytest on macos
Browse files Browse the repository at this point in the history
Fix #2
  • Loading branch information
Freed-Wu committed Dec 3, 2024
1 parent 6c24477 commit 998e16a
Showing 1 changed file with 26 additions and 15 deletions.
41 changes: 26 additions & 15 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ jobs:
include:
- runs-on: ubuntu-latest
shell: bash
# SystemError: PyDescr_NewMember used with Py_RELATIVE_OFFSET
# - runs-on: macos-latest
# shell: bash
- runs-on: macos-latest
shell: bash
- runs-on: windows-latest
shell: msys2
runs-on: ${{matrix.runs-on}}
Expand All @@ -49,20 +48,26 @@ jobs:
run: |
sudo apt-get -y update
sudo apt-get -y install librime-dev
- name: Install dependencies
if: runner.os == 'macOS'
run: |
brew tap tonyfettes/homebrew-rime
brew install librime
- name: Install dependencies
if: runner.os == 'Windows'
run: |
pacman -Sy --noconfirm mingw-w64-x86_64-pkg-config \
mingw-w64-x86_64-librime mingw-w64-x86_64-python-pip \
mingw-w64-x86_64-ninja mingw-w64-x86_64-gcc
- uses: cachix/install-nix-action@v24
if: runner.os == 'macOS'
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
extra_nix_config: |
experimental-features = nix-command flakes
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- name: Install dependencies
if: runner.os == 'macOS'
run: |
nix-env -if'<nixpkgs>' librime
- name: Test
run: |
pip install .[dev]
PKG_CONFIG_PATH="$HOME/.nix-profile/lib/pkgconfig" pip install .[dev]
pytest --cov
- uses: codecov/codecov-action@v4

Expand Down Expand Up @@ -95,11 +100,6 @@ jobs:
run: |
sudo apt-get -y update
sudo apt-get -y install librime-dev
- name: Install dependencies
if: runner.os == 'macOS'
run: |
brew tap tonyfettes/homebrew-rime
brew install librime
- name: Install dependencies
if: runner.os == 'Windows'
# Dist currently only works with Git or Mercurial repos
Expand All @@ -109,6 +109,17 @@ jobs:
mingw-w64-x86_64-ninja \
mingw-w64-x86_64-librime \
mingw-w64-x86_64-python-build git
- uses: cachix/install-nix-action@v24
if: runner.os == 'macOS'
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
extra_nix_config: |
experimental-features = nix-command flakes
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- name: Install dependencies
if: runner.os == 'macOS'
run: |
nix-env -if'<nixpkgs>' librime
- name: Upgrade version
if: startsWith(github.ref, 'refs/tags/')
run: |
Expand All @@ -134,7 +145,7 @@ jobs:
pip install build
- name: Build
run: |
pyproject-build -w
PKG_CONFIG_PATH="$HOME/.nix-profile/lib/pkgconfig" pyproject-build -w
- if: runner.os == 'Linux'
run: |
pyproject-build -s
Expand Down

0 comments on commit 998e16a

Please sign in to comment.