Skip to content

Commit 6f32613

Browse files
authored
Merge branch 'IfcOpenShell:v0.7.0' into v0.7.0
2 parents 41a8591 + ed8cbff commit 6f32613

2,228 files changed

Lines changed: 1753236 additions & 54016 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/cd.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- run: echo ok go
1717

1818
build:
19-
runs-on: ubuntu-20.04
19+
runs-on: ubuntu-latest
2020
needs: activate
2121
steps:
2222
- uses: actions/checkout@v2
@@ -29,7 +29,7 @@ jobs:
2929
sudo apt-get install --no-install-recommends \
3030
git cmake gcc g++ libboost-all-dev python3-all-dev swig libpcre3-dev libxml2-dev \
3131
libocct-foundation-dev libocct-modeling-algorithms-dev libocct-modeling-data-dev libocct-ocaf-dev libocct-visualization-dev libocct-data-exchange-dev \
32-
libhdf5-dev libcgal-dev
32+
libhdf5-dev libcgal-dev nlohmann-json3-dev
3333
3434
-
3535
name: ccache
@@ -61,6 +61,8 @@ jobs:
6161
-DGMP_LIBRARY_DIR=/usr/lib/x86_64-linux-gnu \
6262
-DMPFR_LIBRARY_DIR=/usr/lib/x86_64-linux-gnu \
6363
-DHDF5_INCLUDE_DIR=/usr/include/hdf5/serial \
64+
-DGLTF_SUPPORT=On \
65+
-DJSON_INCLUDE_DIR=/usr/include \
6466
../cmake
6567
make -j $(nproc)
6668
make install
@@ -78,7 +80,7 @@ jobs:
7880
path: build/assets/Ifc*
7981

8082
deliver:
81-
runs-on: ubuntu-20.04
83+
runs-on: ubuntu-latest
8284
needs: build
8385
name: Docker Build, Tag, Push
8486

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
import pathlib
2+
import shutil
3+
4+
import requests
5+
import zipfile
6+
import os
7+
8+
# To test this locally, set these environment variables
9+
REPO_OWNER = os.environ.get("REPO_OWNER", "IfcOpenShell/IfcOpenShell")
10+
MY_WORKFLOW = os.environ.get("MY_WORKFLOW", "ci-ifcopenshell-conda-daily")
11+
WORKFLOW_RUN_ID = os.environ.get("WORKFLOW_RUN_ID", None)
12+
TOKEN = os.environ.get("GITHUB_TOKEN", None)
13+
# To test this locally create a fine-grained personal access token for this repo with permissions "actions:read"
14+
# See https://github.com/settings/tokens?type=beta
15+
16+
# This is a list of strings that indicate that a job has stopped abruptly.
17+
SIGNS_OF_STOPPAGE = [
18+
"Error: The operation was canceled.",
19+
"fatal error C1060: compiler is out of heap space",
20+
]
21+
22+
23+
def start_request_session():
24+
s = requests.Session()
25+
headers = {
26+
"Accept": "application/vnd.github+json",
27+
"X-GitHub-Api-Version": "2022-11-28",
28+
}
29+
if TOKEN:
30+
headers["Authorization"] = f"Bearer {TOKEN}"
31+
32+
s.headers = headers
33+
return s
34+
35+
36+
def get_ci_run(repo_name, run_id):
37+
url = f"https://api.github.com/repos/{repo_name}/actions/runs/{run_id}"
38+
s = start_request_session()
39+
response = s.get(url)
40+
return response.json()
41+
42+
43+
def evaluate_log_file_for_abrupt_stop(log_file):
44+
with open(log_file) as f:
45+
for i, line in enumerate(f):
46+
for sign in SIGNS_OF_STOPPAGE:
47+
if sign in line:
48+
print(f"Found sign of abrupt stoppage in [line {i}]: '{sign}'")
49+
return True
50+
return False
51+
52+
53+
def get_ci_specific_run_specific_failure_details(repo_name, run_id):
54+
url = f"https://api.github.com/repos/{repo_name}/actions/runs/{run_id}/attempts/1/logs"
55+
s = start_request_session()
56+
response = s.get(url)
57+
58+
# SAVE zip file
59+
with open("logs.zip", "wb") as f:
60+
f.write(response.content)
61+
62+
# unzip file
63+
with zipfile.ZipFile("logs.zip", "r") as zip_ref:
64+
zip_ref.extractall("logs")
65+
66+
failed_logs = []
67+
for file in pathlib.Path("logs").iterdir():
68+
if file.is_dir():
69+
continue
70+
71+
if evaluate_log_file_for_abrupt_stop(file):
72+
failed_logs.append(file)
73+
74+
return failed_logs
75+
76+
77+
def restart_job(repo_name, job_id):
78+
url = f"https://api.github.com/repos/{repo_name}/actions/runs/{job_id}/rerun-failed-jobs"
79+
s = start_request_session()
80+
response = s.post(url)
81+
return response.json()
82+
83+
84+
def eval_jobs():
85+
run = get_ci_run(REPO_OWNER, WORKFLOW_RUN_ID)
86+
if run["run_attempt"] > 1:
87+
print("This is not the first attempt. Exiting")
88+
return
89+
failed_logs = get_ci_specific_run_specific_failure_details(REPO_OWNER, WORKFLOW_RUN_ID)
90+
91+
if len(failed_logs) == 0:
92+
print("No runs exhibit signs of abrupt stoppage")
93+
return
94+
95+
print("restarting job", WORKFLOW_RUN_ID)
96+
r = restart_job(REPO_OWNER, WORKFLOW_RUN_ID)
97+
print(r)
98+
99+
shutil.rmtree("logs")
100+
os.remove("logs.zip")
101+
102+
103+
if __name__ == "__main__":
104+
eval_jobs()

.github/workflows/ci-bcf-pypi.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: ci-bcf-pypi
2+
3+
on:
4+
schedule:
5+
# ┌───────────── minute (0 - 59)
6+
# │ ┌───────────── hour (0 - 23)
7+
# │ │ ┌───────────── day of the month (1 - 31)
8+
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
9+
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
10+
# * * * * *
11+
- cron: "0 0 18 * *"
12+
push:
13+
paths:
14+
- '.github/workflows/ci-bcf-pypi.yml'
15+
workflow_dispatch:
16+
17+
env:
18+
major: 0
19+
minor: 0
20+
name: ifcopenshell
21+
22+
jobs:
23+
activate:
24+
runs-on: ubuntu-latest
25+
if: |
26+
github.repository == 'IfcOpenShell/IfcOpenShell'
27+
steps:
28+
- name: Set env
29+
run: echo ok go
30+
31+
build:
32+
needs: activate
33+
name: ${{ matrix.config.name }}-${{ matrix.pyver }}
34+
runs-on: ubuntu-latest
35+
strategy:
36+
fail-fast: false
37+
steps:
38+
- uses: actions/checkout@v2 # https://github.com/actions/checkout
39+
- uses: actions/setup-python@v2 # https://github.com/actions/setup-python
40+
with:
41+
python-version: '3.10' # Version range or exact version of a Python version to use, using SemVer's version range syntax
42+
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
43+
- run: echo ${{ env.DATE }}
44+
- name: Get current date
45+
id: date
46+
run: echo "::set-output name=date::$(date +'%y%m%d')"
47+
- name: Compile
48+
run: |
49+
pip install build
50+
cd src/bcf &&
51+
make dist
52+
- name: Publish a Python distribution to PyPI
53+
uses: ortega2247/pypi-upload-action@master
54+
with:
55+
user: __token__
56+
password: ${{ secrets.PYPI_API_TOKEN }}
57+
packages_dir: src/bcf/dist

.github/workflows/ci-bcf.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.

.github/workflows/ci-blenderbim-choco.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
- uses: actions/checkout@v2
4444
- uses: actions/setup-python@v2 # https://github.com/actions/setup-python
4545
with:
46-
python-version: '3.7.7' # Version range or exact version of a Python version to use, using SemVer's version range syntax
46+
python-version: '3.10.9' # Version range or exact version of a Python version to use, using SemVer's version range syntax
4747
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
4848
- run: echo ${{ env.DATE }}
4949

.github/workflows/ci-blenderbim-matrix.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
strategy:
4040
fail-fast: false
4141
matrix:
42-
pyver: [py37, py39, py310]
42+
pyver: [py39, py310, py311, py312]
4343
config:
4444
- {
4545
name: "Windows Build",
@@ -61,8 +61,8 @@ jobs:
6161
- uses: actions/checkout@v2
6262
- uses: actions/setup-python@v2 # https://github.com/actions/setup-python
6363
with:
64-
python-version: '3.7.7' # Version range or exact version of a Python version to use, using SemVer's version range syntax
6564
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
65+
python-version: '3.11'
6666
- run: echo ${{ env.DATE }}
6767
- name: Get current date
6868
id: date
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: ci-bsdd-pypi
2+
3+
on:
4+
schedule:
5+
# ┌───────────── minute (0 - 59)
6+
# │ ┌───────────── hour (0 - 23)
7+
# │ │ ┌───────────── day of the month (1 - 31)
8+
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
9+
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
10+
# * * * * *
11+
- cron: "0 0 18 * *"
12+
workflow_dispatch:
13+
14+
env:
15+
major: 0
16+
minor: 0
17+
name: ifcopenshell
18+
19+
jobs:
20+
activate:
21+
runs-on: ubuntu-latest
22+
if: |
23+
github.repository == 'IfcOpenShell/IfcOpenShell'
24+
steps:
25+
- name: Set env
26+
run: echo ok go
27+
28+
build:
29+
needs: activate
30+
runs-on: ubuntu-latest
31+
strategy:
32+
fail-fast: false
33+
steps:
34+
- uses: actions/checkout@v2
35+
- uses: actions/setup-python@v2 # https://github.com/actions/setup-python
36+
with:
37+
python-version: '3.11' # Version range or exact version of a Python version to use, using SemVer's version range syntax
38+
- name: Compile
39+
run: |
40+
pip install build
41+
cd src/bsdd &&
42+
make dist
43+
- name: Publish a Python distribution to PyPI
44+
uses: ortega2247/pypi-upload-action@master
45+
with:
46+
user: __token__
47+
password: ${{ secrets.PYPI_API_TOKEN }}
48+
packages_dir: src/bsdd/dist
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: ci-ifcclash-pypi
2+
3+
on:
4+
schedule:
5+
# ┌───────────── minute (0 - 59)
6+
# │ ┌───────────── hour (0 - 23)
7+
# │ │ ┌───────────── day of the month (1 - 31)
8+
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
9+
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
10+
# * * * * *
11+
- cron: "0 0 18 * *"
12+
workflow_dispatch:
13+
14+
env:
15+
major: 0
16+
minor: 0
17+
name: ifcopenshell
18+
19+
jobs:
20+
activate:
21+
runs-on: ubuntu-latest
22+
if: |
23+
github.repository == 'IfcOpenShell/IfcOpenShell'
24+
steps:
25+
- name: Set env
26+
run: echo ok go
27+
28+
build:
29+
needs: activate
30+
runs-on: ubuntu-latest
31+
strategy:
32+
fail-fast: false
33+
steps:
34+
- uses: actions/checkout@v2
35+
- uses: actions/setup-python@v2 # https://github.com/actions/setup-python
36+
with:
37+
python-version: '3.11' # Version range or exact version of a Python version to use, using SemVer's version range syntax
38+
- name: Compile
39+
run: |
40+
pip install build
41+
cd src/ifcclash &&
42+
make dist
43+
- name: Publish a Python distribution to PyPI
44+
uses: ortega2247/pypi-upload-action@master
45+
with:
46+
user: __token__
47+
password: ${{ secrets.PYPI_API_TOKEN }}
48+
packages_dir: src/ifcclash/dist

0 commit comments

Comments
 (0)