aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/.github/workflows/python.yml
blob: 42c8386741601578f225a1ea0fe8e7a19cb8b74f (plain) (blame)
1
2
3
4
5
6
7
8
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
name: Boost.Python

on:
  push:
  pull_request:
  schedule:
    # Weekly, at 5:45 AM on Friday (somewhat randomly chosen).
    - cron: '45 5 * * 5'
  workflow_dispatch:

jobs:
  python:
    strategy:
      matrix:
        os: [ubuntu-latest, windows-latest]
        include:
          - version: '1.78.0'

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

    name: 'Boost.Python: ${{ matrix.version }} / ${{ matrix.os }}'

    defaults:
      run:
        shell: pwsh

    steps:
      - name: Checkout
        uses: actions/checkout@v3

      - name: Set up Python
        uses: actions/setup-python@v4
        with:
          python-version: '3.x'

      - name: Cache Boost
        uses: actions/cache@v3
        with:
          path: '${{ runner.workspace }}/boost_*.tar.gz'
          key: 'boost-${{ matrix.version }}'

      - id: build
        name: Build Boost
        uses: ./
        with:
          version: '${{ matrix.version }}'
          libraries: python

      - name: Fix PATH
        run: |
          $bin_dir = & python -c "import sysconfig; print(sysconfig.get_path('scripts', 'nt_user'))"
          echo $bin_dir >> $env:GITHUB_PATH
        if: runner.os == 'Windows'

      - name: Build an example module
        run: |
          cmake-build --platform x64 --boost '${{ steps.build.outputs.root }}' --configuration Release -- ./examples/python/