Skip to content

Commit 6aea336

Browse files
Krandeaothms
authored andcommitted
Add proposal for CI workflow on PR and commits
1 parent 1ae7bd3 commit 6aea336

2 files changed

Lines changed: 169 additions & 90 deletions

File tree

.github/workflows/cd.yml

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
name: CD
2+
3+
on:
4+
push:
5+
6+
7+
jobs:
8+
9+
activate:
10+
runs-on: ubuntu-latest
11+
if: |
12+
github.repository == 'IfcOpenShell/IfcOpenShell' &&
13+
!startsWith(github.event.head_commit.message, 'Release ') &&
14+
!contains(github.event.head_commit.message, 'ci skip')
15+
steps:
16+
- run: echo ok go
17+
18+
build:
19+
runs-on: ubuntu-20.04
20+
needs: activate
21+
steps:
22+
- uses: actions/checkout@v2
23+
24+
- name: Install dependencies
25+
run: |
26+
sudo apt update
27+
sudo apt-get install --no-install-recommends \
28+
git cmake gcc g++ libboost1.67-all-dev python3-all-dev swig libpcre3-dev libxml2-dev \
29+
liboce-foundation-dev liboce-modeling-dev liboce-ocaf-dev liboce-visualization-dev liboce-ocaf-lite-dev
30+
31+
-
32+
name: ccache
33+
uses: hendrikmuhs/ccache-action@v1
34+
35+
-
36+
name: Build ifcopenshell
37+
run: |
38+
mkdir build && cd build
39+
cmake \
40+
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
41+
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
42+
-DCMAKE_INSTALL_PREFIX=$PWD/install/ \
43+
-DCMAKE_BUILD_TYPE=Release \
44+
-DCMAKE_PREFIX_PATH=/usr \
45+
-DCMAKE_SYSTEM_PREFIX_PATH=/usr \
46+
-DBUILD_PACKAGE=On \
47+
-DOCC_INCLUDE_DIR=/usr/include/oce \
48+
-DOCC_LIBRARY_DIR=/usr/lib/x86_64-linux-gnu \
49+
-DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3 \
50+
-DPYTHON_INCLUDE_DIR:PATH=/usr/include/python3.8 \
51+
-DPYTHON_LIBRARY:FILEPATH=/usr/lib/x86_64-linux-gnu/libpython3.8.so \
52+
-DCOLLADA_SUPPORT=Off \
53+
-DLIBXML2_INCLUDE_DIR=/usr/include/libxml2 \
54+
-DLIBXML2_LIBRARIES=/usr/lib/x86_64-linux-gnu/libxml2.so \
55+
../cmake
56+
make -j $(nproc)
57+
make install
58+
-
59+
name: Package
60+
run: |
61+
make package
62+
working-directory: build
63+
- name: Upload
64+
uses: actions/upload-artifact@v2
65+
with:
66+
# Artifact name
67+
name: ifcos-artifacts
68+
# Directory containing files to upload
69+
path: build/assets/Ifc*
70+
71+
deliver:
72+
runs-on: ubuntu-20.04
73+
needs: build
74+
name: Docker Build, Tag, Push
75+
76+
steps:
77+
- uses: actions/checkout@v2
78+
with:
79+
lfs: true
80+
81+
- name: Download
82+
uses: actions/download-artifact@v2
83+
with:
84+
# Artifact name
85+
name: ifcos-artifacts
86+
path: artifacts/
87+
-
88+
name: Set up QEMU
89+
uses: docker/setup-qemu-action@v1
90+
-
91+
name: Set up Docker Buildx
92+
uses: docker/setup-buildx-action@v1
93+
-
94+
name: Login to Dockerhub
95+
uses: docker/login-action@v1
96+
with:
97+
username: aecgeeks
98+
password: ${{ secrets.DOCKER_HUB_TOKEN }}
99+
-
100+
name: Build container image
101+
uses: docker/build-push-action@v2
102+
with:
103+
context: artifacts
104+
repository: aecgeeks/ifcopenshell
105+
tags: aecgeeks/ifcopenshell:latest
106+
file: ./Dockerfile
107+
push: true

.github/workflows/ci.yml

Lines changed: 62 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -1,107 +1,79 @@
1-
name: CI
1+
name: ci
22

3-
on:
3+
on:
44
push:
5-
5+
paths:
6+
- 'src/**'
7+
- 'test/**'
8+
- 'conda/**'
9+
- 'cmake/**'
10+
- '.github/workflows/ci.yml'
11+
pull_request:
612

713
jobs:
8-
914
activate:
1015
runs-on: ubuntu-latest
1116
if: |
1217
github.repository == 'IfcOpenShell/IfcOpenShell' &&
13-
!startsWith(github.event.head_commit.message, 'Release ') &&
14-
!contains(github.event.head_commit.message, 'ci skip')
18+
!contains(github.event.head_commit.message, 'skip ci')
1519
steps:
16-
- run: echo ok go
20+
- run: echo ok go
1721

1822
build:
1923
runs-on: ubuntu-20.04
2024
needs: activate
2125
steps:
22-
- uses: actions/checkout@v2
23-
24-
- name: Install dependencies
25-
run: |
26-
sudo apt update
27-
sudo apt-get install --no-install-recommends \
28-
git cmake gcc g++ libboost1.67-all-dev python3-all-dev swig libpcre3-dev libxml2-dev \
29-
liboce-foundation-dev liboce-modeling-dev liboce-ocaf-dev liboce-visualization-dev liboce-ocaf-lite-dev
26+
- uses: actions/checkout@v2
27+
with:
28+
submodules: recursive
29+
- name: Install dependencies
30+
run: |
31+
sudo apt update
32+
sudo apt-get install --no-install-recommends \
33+
git cmake gcc g++ \
34+
libboost-date-time-dev \
35+
libboost-filesystem-dev \
36+
libboost-iostreams-dev \
37+
libboost-program-options-dev \
38+
libboost-regex-dev \
39+
libboost-system-dev \
40+
libboost-thread-dev \
41+
python3-all-dev python3-pip \
42+
swig libpcre3-dev libxml2-dev \
43+
libtbb-dev nlohmann-json3-dev \
44+
liboce-foundation-dev liboce-modeling-dev liboce-ocaf-dev liboce-visualization-dev liboce-ocaf-lite-dev
45+
- name: ccache
46+
uses: hendrikmuhs/ccache-action@v1
3047

31-
-
32-
name: ccache
33-
uses: hendrikmuhs/ccache-action@v1
48+
- name: Build ifcopenshell
49+
run: |
50+
mkdir build && cd build
51+
cmake \
52+
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
53+
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
54+
-DCMAKE_INSTALL_PREFIX=$PWD/install/ \
55+
-DCMAKE_BUILD_TYPE=Release \
56+
-DCMAKE_PREFIX_PATH=/usr \
57+
-DCMAKE_SYSTEM_PREFIX_PATH=/usr \
58+
-DOCC_INCLUDE_DIR=/usr/include/oce \
59+
-DOCC_LIBRARY_DIR=/usr/lib/x86_64-linux-gnu \
60+
-DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3 \
61+
-DPYTHON_INCLUDE_DIR:PATH=/usr/include/python3.8 \
62+
-DPYTHON_LIBRARY:FILEPATH=/usr/lib/x86_64-linux-gnu/libpython3.8.so \
63+
-DCOLLADA_SUPPORT=Off \
64+
"-DSCHEMA_VERSIONS=2x3;4" \
65+
-DGLTF_SUPPORT=On \
66+
-DJSON_INCLUDE_DIR=/usr/include \
67+
../cmake
68+
sudo make -j $(nproc)
69+
sudo make install
3470
35-
-
36-
name: Build ifcopenshell
37-
run: |
38-
mkdir build && cd build
39-
cmake \
40-
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
41-
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
42-
-DCMAKE_INSTALL_PREFIX=$PWD/install/ \
43-
-DCMAKE_BUILD_TYPE=Release \
44-
-DCMAKE_PREFIX_PATH=/usr \
45-
-DCMAKE_SYSTEM_PREFIX_PATH=/usr \
46-
-DBUILD_PACKAGE=On \
47-
-DOCC_INCLUDE_DIR=/usr/include/oce \
48-
-DOCC_LIBRARY_DIR=/usr/lib/x86_64-linux-gnu \
49-
-DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3 \
50-
-DPYTHON_INCLUDE_DIR:PATH=/usr/include/python3.8 \
51-
-DPYTHON_LIBRARY:FILEPATH=/usr/lib/x86_64-linux-gnu/libpython3.8.so \
52-
-DCOLLADA_SUPPORT=Off \
53-
-DLIBXML2_INCLUDE_DIR=/usr/include/libxml2 \
54-
-DLIBXML2_LIBRARIES=/usr/lib/x86_64-linux-gnu/libxml2.so \
55-
../cmake
56-
make -j $(nproc)
57-
make install
58-
-
59-
name: Package
60-
run: |
61-
make package
62-
working-directory: build
63-
- name: Upload
64-
uses: actions/upload-artifact@v2
65-
with:
66-
# Artifact name
67-
name: ifcos-artifacts
68-
# Directory containing files to upload
69-
path: build/assets/Ifc*
71+
- name: install xmlschema
72+
run: |
73+
sudo /usr/bin/python -m pip install -U pip
74+
sudo /usr/bin/python -m pip install xmlschema
7075
71-
deliver:
72-
runs-on: ubuntu-20.04
73-
needs: build
74-
name: Docker Build, Tag, Push
75-
76-
steps:
77-
- uses: actions/checkout@v2
78-
with:
79-
lfs: true
80-
81-
- name: Download
82-
uses: actions/download-artifact@v2
83-
with:
84-
# Artifact name
85-
name: ifcos-artifacts
86-
path: artifacts/
87-
-
88-
name: Set up QEMU
89-
uses: docker/setup-qemu-action@v1
90-
-
91-
name: Set up Docker Buildx
92-
uses: docker/setup-buildx-action@v1
93-
-
94-
name: Login to Dockerhub
95-
uses: docker/login-action@v1
96-
with:
97-
username: aecgeeks
98-
password: ${{ secrets.DOCKER_HUB_TOKEN }}
99-
-
100-
name: Build container image
101-
uses: docker/build-push-action@v2
102-
with:
103-
context: artifacts
104-
repository: aecgeeks/ifcopenshell
105-
tags: aecgeeks/ifcopenshell:latest
106-
file: ./Dockerfile
107-
push: true
76+
- name: Test
77+
run: |
78+
sudo /usr/bin/python test/tests.py
79+
sudo /usr/bin/python src/ifcopenshell-python/ifcopenshell/test_ids.py

0 commit comments

Comments
 (0)