File: ci.yml

package info (click to toggle)
pybdsf 1.13.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 22,188 kB
  • sloc: fortran: 40,850; python: 14,895; ansic: 4,347; cpp: 1,586; makefile: 131; sh: 46
file content (51 lines) | stat: -rw-r--r-- 1,430 bytes parent folder | download | duplicates (2)
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
name: Build and test PyBDSF

on:
  pull_request:
  push:
    branches: ["master"]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4
    - uses: actions/setup-python@v5
      with:
        python-version: "3.12"

    - name: Get environment variables from pyproject.toml
      shell: python
      run: |
        import os, re, tomllib

        with open("pyproject.toml", "rb") as f:
            toml = tomllib.load(f)

        # Extract key-value pairs from the environment used by cibuildwheel
        matches = re.findall(
            r'(\w+)=(".*?"|\S+)',
            toml["tool"]["cibuildwheel"]["environment"]
        )

        # Add every key-value pair to the environment, so that if a value contains an
        # environment variable, it can be expanded before it is added to GITHUB_ENV.
        # This is needed, because variables in GITHUB_ENV will not be expanded.
        with open(os.environ["GITHUB_ENV"], "a") as f:
          for key, value in matches:
            value = os.path.expandvars(value.strip('"'))
            os.environ[key] = value
            f.write(f"{key}={value}\n")

    - name: Build and install Boost
      run: |
        cibuildwheel/before_all.sh
        cibuildwheel/before_build.sh

    - name: Build and install PyBDSF
      run: |
        python -m pip install .

    - name: Test PyBDSF
      run: |
        cd test && python tbdsf_process_image.py