Thanks to visit codestin.com
Credit goes to github.com

Skip to content

CI: Get a working F2PY Windows runner #26708

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 24 additions & 5 deletions .github/workflows/circleci.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,36 @@
# To enable this workflow on a fork, comment out:
#
# if: github.repository == 'numpy/numpy'

name: CircleCI artifact redirector

on: [status]

permissions: read-all

jobs:
get_commit_tags:
name: Get commit tags
runs-on: ubuntu-latest
# To enable this workflow on a fork, comment out:
if: "github.repository == 'numpy/numpy'"
outputs:
message: ${{ steps.commit_message.outputs.message }}
steps:
- name: Checkout project
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Get commit message
id: commit_message
run: |
set -xe
COMMIT_TAGS=$(git log --format=%B -n 1 | grep -o '\[[^]]*\]' | tr '\n' ' ' | xargs || true)
echo "message=$COMMIT_TAGS" >> $GITHUB_OUTPUT
echo github.ref ${{ github.ref }}
circleci_artifacts_redirector_job:
runs-on: ubuntu-latest
if: "github.repository == 'numpy/numpy' && !contains(github.event.head_commit.message, '[circle skip]') && !contains(github.event.head_commit.message, '[skip circle]') && github.event.context == 'ci/circleci: build'"
needs: get_commit_tags
if: >-
!contains(needs.get_commit_tags.outputs.message, '[circle skip]') &&
!contains(needs.get_commit_tags.outputs.message, '[skip circle]') &&
github.event.context == 'ci/circleci: build'
name: Run CircleCI artifacts redirector
permissions:
statuses: write
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,32 @@ permissions:
contents: read

jobs:
get_commit_tags:
name: Get commit tags
runs-on: ubuntu-latest
# To enable this workflow on a fork, comment out:
if: "github.repository == 'numpy/numpy'"
outputs:
message: ${{ steps.commit_message.outputs.message }}
steps:
- name: Checkout project
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Get commit message
id: commit_message
run: |
set -xe
COMMIT_TAGS=$(git log --format=%B -n 1 | grep -o '\[[^]]*\]' | tr '\n' ' ' | xargs || true)
echo "message=$COMMIT_TAGS" >> $GITHUB_OUTPUT
echo github.ref ${{ github.ref }}
analyze:
name: Analyze
runs-on: ubuntu-latest
needs: get_commit_tags
if: >-
!contains(needs.get_commit_tags.outputs.message, '[codeql skip]') &&
!contains(needs.get_commit_tags.outputs.message, '[skip codeql]')
permissions:
actions: read
contents: read
Expand Down
25 changes: 23 additions & 2 deletions .github/workflows/cygwin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,31 @@ permissions:
contents: read # to fetch code (actions/checkout)

jobs:
get_commit_tags:
name: Get commit tags
runs-on: ubuntu-latest
# To enable this workflow on a fork, comment out:
if: "github.repository == 'numpy/numpy'"
outputs:
message: ${{ steps.commit_message.outputs.message }}
steps:
- name: Checkout project
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Get commit message
id: commit_message
run: |
set -xe
COMMIT_TAGS=$(git log --format=%B -n 1 | grep -o '\[[^]]*\]' | tr '\n' ' ' | xargs || true)
echo "message=$COMMIT_TAGS" >> $GITHUB_OUTPUT
echo github.ref ${{ github.ref }}
cygwin_build_test:
runs-on: windows-latest
# To enable this workflow on a fork, comment out:
if: github.repository == 'numpy/numpy'
needs: get_commit_tags
if: >-
!contains(needs.get_commit_tags.outputs.message, '[cygwin skip]') &&
!contains(needs.get_commit_tags.outputs.message, '[skip cygwin]')
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
Expand Down
25 changes: 23 additions & 2 deletions .github/workflows/emscripten.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,32 @@ permissions:
contents: read # to fetch code (actions/checkout)

jobs:
get_commit_tags:
name: Get commit tags
runs-on: ubuntu-latest
# To enable this workflow on a fork, comment out:
if: "github.repository == 'numpy/numpy'"
outputs:
message: ${{ steps.commit_message.outputs.message }}
steps:
- name: Checkout project
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Get commit message
id: commit_message
run: |
set -xe
COMMIT_TAGS=$(git log --format=%B -n 1 | grep -o '\[[^]]*\]' | tr '\n' ' ' | xargs || true)
echo "message=$COMMIT_TAGS" >> $GITHUB_OUTPUT
echo github.ref ${{ github.ref }}
build-wasm-emscripten:
name: Build NumPy distribution for Pyodide
runs-on: ubuntu-22.04
# To enable this workflow on a fork, comment out:
if: github.repository == 'numpy/numpy'
needs: get_commit_tags
if: >-
!contains(needs.get_commit_tags.outputs.message, '[wasm skip]') &&
!contains(needs.get_commit_tags.outputs.message, '[skip wasm]')
env:
PYODIDE_VERSION: 0.26.0
# PYTHON_VERSION and EMSCRIPTEN_VERSION are determined by PYODIDE_VERSION.
Expand Down
90 changes: 90 additions & 0 deletions .github/workflows/f2py_windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: Windows F2PY tests

on:
push:
branches:
- maintenance/**
pull_request:
branches:
- main
- maintenance/**
workflow_dispatch:

permissions:
contents: read # to fetch code (actions/checkout)

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
get_commit_tags:
name: Get commit tags
runs-on: ubuntu-latest
# To enable this workflow on a fork, comment out:
if: "github.repository == 'numpy/numpy'"
outputs:
message: ${{ steps.commit_message.outputs.message }}
steps:
- name: Checkout project
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Get commit message
id: commit_message
run: |
set -xe
COMMIT_TAGS=$(git log --format=%B -n 1 | grep -o '\[[^]]*\]' | tr '\n' ' ' | xargs || true)
echo "message=$COMMIT_TAGS" >> $GITHUB_OUTPUT
echo github.ref ${{ github.ref }}
test_f2py_rtools:
name: cp311 (meson) f2py rtools
runs-on: windows-2019
needs: get_commit_tags
if: >-
contains(needs.get_commit_tags.outputs.message, '[winci f2py]') ||
contains(needs.get_commit_tags.outputs.message, '[f2py winci]') ||
github.event_name == 'schedule' ||
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && ( ! endsWith(github.ref, 'dev0')))
steps:
- name: Checkout
uses: actions/[email protected]
with:
submodules: recursive
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
architecture: 'x64'
cache: 'pip'
cache-dependency-path: 'environment.yml'
- name: Setup Cache for Rtools
id: cache-rtools
uses: actions/cache@v3
with:
path: C:\rtools43
key: ${{ runner.os }}-rtools43-${{ hashFiles('**/rtools43-cache-key') }}
restore-keys: |
${{ runner.os }}-rtools43-
# NumPy needs min GCC 8.2 so rtools >= 4.3
# 4.4.6104 is already present on windows-2019
# RTools Ver <-> GCC Ver
# RTools 4.0 <-> GCC 8
# RTools 4.3 <-> GCC 12
# RTools 4.4 <-> GCC 13
- name: Install rtools (mingw-w64) if not cached
if: steps.cache-rtools.outputs.cache-hit != 'true'
run: |
Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1
choco install -y --stoponfirstfailure --checksum 6004DF17818F5A6DBF19CB335CC92702 pkgconfiglite
choco install rtools -y --no-progress --force --version=4.3.5550
echo "c:\rtools43\mingw64\bin;" >> $env:GITHUB_PATH
- name: pip-packages
run: |
python -m pip install -r requirements/f2pyCI_requirements.txt
- name: Build and test # Fastest build, no BLAS or SIMD
run: |
$env:PATH="C:\\rtools43\\mingw64\\bin;$env:PATH"
python -mspin build -j2 -- -Dallow-noblas=true -Dcpu-baseline=none -Dcpu-dispatch=none
python -mspin test -t numpy.f2py -m full -- -vvvvvv
25 changes: 23 additions & 2 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,25 @@ permissions:
contents: read # to fetch code (actions/checkout)

jobs:
get_commit_tags:
name: Get commit tags
runs-on: ubuntu-latest
# To enable this workflow on a fork, comment out:
if: "github.repository == 'numpy/numpy'"
outputs:
message: ${{ steps.commit_message.outputs.message }}
steps:
- name: Checkout project
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Get commit message
id: commit_message
run: |
set -xe
COMMIT_TAGS=$(git log --format=%B -n 1 | grep -o '\[[^]]*\]' | tr '\n' ' ' | xargs || true)
echo "message=$COMMIT_TAGS" >> $GITHUB_OUTPUT
echo github.ref ${{ github.ref }}
lint:
# To enable this job and subsequent jobs on a fork, comment out:
if: github.repository == 'numpy/numpy' && github.event_name != 'push'
Expand All @@ -48,8 +67,10 @@ jobs:
python tools/linter.py --branch origin/${{ github.base_ref }}

smoke_test:
# To enable this job on a fork, comment out:
if: github.repository == 'numpy/numpy'
needs: get_commit_tags
if: >-
!contains(needs.get_commit_tags.outputs.message, '[linux skip]') &&
!contains(needs.get_commit_tags.outputs.message, '[skip linux]')
runs-on: ubuntu-latest
env:
MESON_ARGS: "-Dallow-noblas=true -Dcpu-baseline=none -Dcpu-dispatch=none"
Expand Down
Loading
Loading