build_variants.yml 2.55 KB
Newer Older
Simon Ward's avatar
Simon Ward committed
1
# Adapted from https://github.com/RalfG/python-wheels-manylinux-build/blob/master/full_workflow_example.yml
Simon Ward's avatar
Simon Ward committed
2
name: Build CFML wheels on various systems
Simon Ward's avatar
Simon Ward committed
3
4
5
6
7
8

on:
  push:
    branches: [ simon ]

jobs:
Simon Ward's avatar
Simon Ward committed
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
  create-Linux:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2

    - name: Build manylinux wheels
      run:  docker run -e PLAT=manylinux2010_x86_64 -v `pwd`:/io quay.io/pypa/manylinux2010_x86_64 /io/Scripts/buildscript.sh

    - uses: actions/upload-artifact@v2
      with:
        name: CrysFML - Linux
        path: ${{ github.workspace }}/dist/*.whl

  create-OSX:
    strategy:
      max-parallel: 4
      matrix:
        python-version: ['3.6', '3.7', '3.8', '3.9']
        os: [macos-10.15]
        gcc_v: [ 10 ] # Version of GFortran we want to use.
#        exclude: # Currently only python > 3.8 is supported on macos-11.0 and > 3.6 on macos-10.15
#          - os: macos-11.0
#            python-version: '3.7'
#          - os: macos-11.0
#            python-version: '3.8'

    runs-on: ${{ matrix.os }}

    steps:
    - uses: actions/checkout@v2

    - name: Setup python
      uses: actions/setup-python@v1
      with:
        python-version: ${{matrix.python-version}}

    - name: Install cmake
      run: pip3 install cmake delocate wheel

    - name: Build CFML (OSX)
      env:
        FC: gfortran-${{ matrix.gcc_v }}
        CC: gcc-${{ matrix.gcc_v }}
      run: |
        pip3 wheel ./ --no-deps -w ./dist/
        delocate-wheel -w fixed_wheels -v ./dist/*.whl

    - uses: actions/upload-artifact@v2
      with:
        name: CrysFML - ${{ matrix.os }} - Python ${{ matrix.python-version }}
        path: ./fixed_wheels/*.whl
Simon Ward's avatar
Simon Ward committed
61

Simon Ward's avatar
Simon Ward committed
62
  create-Windows:
Simon Ward's avatar
Simon Ward committed
63
    strategy:
Simon Ward's avatar
Simon Ward committed
64
      max-parallel: 4
Simon Ward's avatar
Simon Ward committed
65
      matrix:
Simon Ward's avatar
Simon Ward committed
66
67
        python-version: [ '3.6', '3.7', '3.8', '3.9', '3.10' ]
        os: [ windows-latest ]
Simon Ward's avatar
Simon Ward committed
68
69
70
71

    runs-on: ${{ matrix.os }}

    steps:
Simon Ward's avatar
Simon Ward committed
72
      - uses: actions/checkout@v2
Simon Ward's avatar
Simon Ward committed
73

Simon Ward's avatar
Simon Ward committed
74
75
76
77
      - name: Setup python
        uses: actions/setup-python@v1
        with:
          python-version: ${{matrix.python-version}}
Simon Ward's avatar
Simon Ward committed
78

Simon Ward's avatar
Simon Ward committed
79
80
      - name: Install wheel
        run: pip install wheel
Simon Ward's avatar
Simon Ward committed
81

Simon Ward's avatar
Simon Ward committed
82
83
84
      - uses: msys2/setup-msys2@v2
        with:
          msystem: MSYS
Simon Ward's avatar
Simon Ward committed
85
          install: cmake mingw-w64-x86_64-toolchain
Simon Ward's avatar
Simon Ward committed
86
          update: true
Simon Ward's avatar
Simon Ward committed
87
          path-type: inherit
Simon Ward's avatar
Simon Ward committed
88

Simon Ward's avatar
Simon Ward committed
89
90
91
92
93
94
      - name: Build CFML
        shell: msys2 {0}
        id: build
        run: pip wheel ./ --no-deps -w ./dist/
        env:
          MINGW_ARCH: MINGW64
Simon Ward's avatar
Simon Ward committed
95

Simon Ward's avatar
Simon Ward committed
96
97
98
99
      - uses: actions/upload-artifact@v2
        with:
          name: CrysFML - ${{ matrix.os }} - Python ${{ matrix.python-version }}
          path: ./dist/*.whl