-
Notifications
You must be signed in to change notification settings - Fork 80
111 lines (94 loc) · 3.34 KB
/
Copy pathcompas-compile-ci.yml
File metadata and controls
111 lines (94 loc) · 3.34 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: COMPAS compile test
on:
workflow_dispatch:
pull_request:
branches:
- dev
paths:
- src/**
- compas_python_utils/**
- py_tests/**
- .github/workflows/**
push:
branches:
- dev
# Ensures only the latest workflow run for the same branch is active, canceling any in-progress runs.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
compas:
env:
ARTIFACT_NAME: detailedEvolutionPlot.png
ARTIFACT_PATH: py_tests/test_artifacts
name: Build COMPAS
runs-on: ubuntu-22.04
container: teamcompas/compas:latest
# TODO: Switch to GHCR when package is made public
# container: ghcr.io/teamcompas/compas:latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build COMPAS from source
run: |
echo "Building COMPAS from source..."
cd src
make clean 2>/dev/null || echo 'No existing build to clean'
make DOCKER_BUILD=1 CPP="g++" -j "$(nproc)" -f Makefile
./COMPAS -v
echo "COMPAS build completed successfully!"
- name: Install Python dependencies
run: |
echo "Installing Python dependencies..."
python3 -m pip install --upgrade pip
pip install -e .[dev]
echo "Python dependencies installed!"
- name: Run example COMPAS job
run: |
echo "Running example COMPAS job..."
export COMPAS_EXECUTABLE_PATH=${GITHUB_WORKSPACE}/src/COMPAS
cd ${GITHUB_WORKSPACE}/py_tests/test_data/
chmod 755 run.sh
echo "Contents of run.sh:"
cat run.sh
./run.sh
echo "Example job completed!"
- name: Run pytest suite
run: |
echo "Running pytest suite..."
cd ${GITHUB_WORKSPACE}
export COMPAS_ROOT_DIR=${GITHUB_WORKSPACE}
if command -v jupyter-kernelspec &> /dev/null; then
echo "Available Jupyter kernels:"
jupyter-kernelspec list
fi
pytest --cov=compas_python_utils/ py_tests/ -m 'not webtest'
pytest --cov=compas_python_utils/ --cov-append py_tests/ -m webtest
echo "Test artifacts:"
ls py_tests/test_artifacts/ 2>/dev/null || echo "No test artifacts found"
coverage html
coverage-badge -o coverage_badge.svg -f
echo "All tests completed successfully!"
- name: Archive code coverage results
uses: actions/upload-artifact@v4
with:
name: code-coverage
path: |
htmlcov/
coverage_badge.svg
- name: Archive COMPAS detailed-evolution plot
id: upload
uses: actions/upload-artifact@v4
with:
name: evolution-plot-${{ github.run_number }}
path: ${{ env.ARTIFACT_PATH }}/${{ env.ARTIFACT_NAME }}
if-no-files-found: error
- name: Test Summary
run: |
echo "### COMPAS CI Results" >> $GITHUB_STEP_SUMMARY
echo "- COMPAS Build: Success" >> $GITHUB_STEP_SUMMARY
echo "- Python Dependencies: Success" >> $GITHUB_STEP_SUMMARY
echo "- Example COMPAS Job: Success" >> $GITHUB_STEP_SUMMARY
echo "- Pytest Suite: Success" >> $GITHUB_STEP_SUMMARY