Build numpy from src in integration test (#65) #237
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
pull_request: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Setup Python | |
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 | |
with: | |
python-version: "3.12" | |
- name: Set up Node.js | |
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 | |
with: | |
node-version: "20" | |
- name: Test | |
run: | | |
python -m pip install --upgrade pip | |
pip install ".[test]" | |
pytest -v \ | |
--junitxml=test-results/junit.xml \ | |
--cov=pyodide-build \ | |
pyodide_build | |
- uses: codecov/codecov-action@015f24e6818733317a2da2edd6290ab26238649a # v5.0.7 | |
with: | |
fail_ci_if_error: false | |
check-integration-test-trigger: | |
name: test-integration-test-trigger | |
runs-on: ubuntu-latest | |
outputs: | |
run-integration-test: ${{ steps.check-integration-test-trigger.outputs.trigger }} | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- id: check-integration-test-trigger | |
name: Check integration test trigger | |
shell: bash | |
run: | | |
set -e -x | |
COMMIT_MSG=$(git log --no-merges -1 --oneline) | |
# The integration tests will be triggered on push or on pull_request when the commit | |
# message contains "[integration]" or if it is pushed to main branch. | |
if [[ "$GITHUB_EVENT_NAME" == push && "$GITHUB_REF" == refs/heads/main || | |
"$COMMIT_MSG" =~ \[integration\] ]]; then | |
echo "trigger=true" >> "$GITHUB_OUTPUT" | |
fi | |
integration-test: | |
runs-on: ubuntu-latest | |
needs: [check-integration-test-trigger] | |
strategy: | |
fail-fast: false | |
matrix: | |
task: [test-recipe, test-src] | |
if: needs.check-integration-test-trigger.outputs.run-integration-test | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
# include tags so that hatch-vcs can infer the version | |
fetch-depth: 0 | |
- name: Setup Python | |
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 | |
with: | |
python-version: "3.12" | |
- name: Set up Node.js | |
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 | |
with: | |
node-version: "20" | |
- name: Install the package | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install . | |
- name: Install xbuildenv | |
run: | | |
pyodide xbuildenv install | |
echo EMSCRIPTEN_VERSION=$(pyodide config get emscripten_version) >> $GITHUB_ENV | |
- name: Install Emscripten | |
uses: mymindstorm/setup-emsdk@6ab9eb1bda2574c4ddb79809fc9247783eaf9021 # v14 | |
with: | |
version: ${{ env.EMSCRIPTEN_VERSION }} | |
- name: Run the integration tests (${{ matrix.task }}) | |
run: | | |
cd integration_tests | |
make ${{ matrix.task }} |