CI Add MacOS build (#3602)

This commit is contained in:
Gyeongjae Choi 2023-03-09 05:22:59 +09:00 committed by GitHub
parent d6ce2b6edd
commit 52c033af9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 47 additions and 8 deletions

View File

@ -2,7 +2,6 @@ name: main
on:
push:
branches: [main]
pull_request:
concurrency:
@ -74,7 +73,11 @@ jobs:
fail_ci_if_error: false
build-core:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
env:
EMSDK_NUM_CORES: 3
EMCC_CORES: 3
@ -89,7 +92,7 @@ jobs:
with:
path: |
/tmp/ccache
key: ${{ hashFiles('Makefile.envs') }}-v20211025-
key: ${{ hashFiles('Makefile.envs') }}-${{ runner.os }}-v20211025-
- uses: conda-incubator/setup-miniconda@v2
with:
@ -103,11 +106,22 @@ jobs:
python --version
which python
- name: Install dependencies
- name: Install dependencies (ubuntu)
shell: bash -l {0}
if: ${{ contains(runner.os, 'ubuntu') }}
run: |
sudo apt install -y build-essential git xxd
conda install -y nodejs ccache f2c pkg-config swig make patch pkg-config texinfo autoconf automake libtool
- name: Install dependencies (macos)
shell: bash -l {0}
if: ${{ contains(runner.os, 'macos') }}
run: |
brew install coreutils
- name: Install dependencies (common)
shell: bash -l {0}
run: |
conda install -y nodejs ccache f2c pkg-config swig make pkg-config texinfo autoconf automake libtool patch sed
pip install -r requirements.txt
- name: Build emsdk
@ -150,12 +164,12 @@ jobs:
- name: Store artifacts build
uses: actions/upload-artifact@v3
with:
name: core-build
name: core-build-${{ runner.os }}
path: ./dist/
retention-days: 60
test-core:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
env:
DISPLAY: :99
@ -163,6 +177,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
runner: [playwright]
browser: [chrome]
@ -172,7 +187,7 @@ jobs:
- name: Download build artifact
uses: actions/download-artifact@v3
with:
name: core-build
name: core-build-${{ runner.os }}
path: ./dist/
- uses: conda-incubator/setup-miniconda@v2

View File

@ -40,8 +40,32 @@ check_cmake() {
check_binary_present "cmake"
}
check_sed() {
check_binary_present "sed"
gnu_sed_found=$(sed --help | grep -q gnu.org)
if [ "${gnu_sed_found}" ]; then
echo >&2 "Pyodide requires GNU sed."
echo >&2 "If you are on macOS you can install it with 'brew install gnu-sed' and then add it to your PATH."
exit 1
fi
}
check_patch() {
check_binary_present "patch"
gnu_patch_found=$(patch --help | grep -q gnu.org)
if [ "${gnu_patch_found}" ]; then
echo >&2 "Pyodide requires GNU patch."
echo >&2 "If you are on macOS you can install it with 'brew install gpatch' and then add it to your PATH."
exit 1
fi
}
check_python_version
check_pkgconfig
check_cmake
check_sed
check_patch
#check_python_headers
check_shasum