Skip to content

Commit 2c8d230

Browse files
Update workflows to use composite actions
1 parent 293c14d commit 2c8d230

5 files changed

Lines changed: 216 additions & 389 deletions

File tree

.github/workflows/canary.yml

Lines changed: 17 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -25,62 +25,41 @@ jobs:
2525
uses: actions/setup-python@v5
2626
with:
2727
python-version: ${{ matrix.python-version }}
28-
29-
- name: Install Homebrew
30-
run: |
31-
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
32-
brew install swig doxygen
33-
34-
- name: "Create virtual Environment"
35-
run: python3 -m venv .venv
36-
- name: "Capture initial package versions"
28+
- name: Capture initial package versions
3729
run: |
38-
source .venv/bin/activate
3930
pip freeze > initial_versions.txt
4031
echo "Initial package versions:" >> $GITHUB_STEP_SUMMARY
4132
cat initial_versions.txt >> $GITHUB_STEP_SUMMARY
4233
echo "\n" >> $GITHUB_STEP_SUMMARY
43-
44-
- name: "Install canary requirements"
45-
run: |
46-
source .venv/bin/activate
47-
pip3 install -r .github/workflows/requirements.txt
48-
pip3 install -r .github/workflows/requirements_dev.txt
49-
pip3 install -r .github/workflows/requirements_doc.txt
50-
pip3 install pytest-error-for-skips
51-
52-
- name: "Capture final package versions"
34+
- name: Build Basilisk
35+
uses: ./.github/actions/build
36+
with:
37+
python-version: ${{ matrix.python-version }}
38+
build-mode: conan
39+
conan-args: --opNav True --allOptPkg --mujoco True --mujocoReplay True --recorderPropertyRollback True --pyPkgCanary True
40+
is-canary: true
41+
install-doc-reqs: true
42+
- name: Capture final package versions
5343
run: |
54-
source .venv/bin/activate
5544
pip freeze > final_versions.txt
5645
echo "Final package versions:" >> $GITHUB_STEP_SUMMARY
5746
cat final_versions.txt >> $GITHUB_STEP_SUMMARY
5847
echo "\n" >> $GITHUB_STEP_SUMMARY
5948
echo "Package version changes:" >> $GITHUB_STEP_SUMMARY
6049
diff -u initial_versions.txt final_versions.txt | grep -E '^[+-]' | grep -v '^+++' | grep -v '^---' >> $GITHUB_STEP_SUMMARY
61-
62-
- name: "Build basilisk with latest dependencies"
63-
run: source .venv/bin/activate && python3 conanfile.py --opNav True --allOptPkg --mujoco True --mujocoReplay True --pyPkgCanary True
64-
65-
- name: "Run Python Tests"
50+
- name: Run Python Tests
51+
working-directory: src
6652
run: |
67-
source .venv/bin/activate
68-
cd src
53+
pip install pytest-error-for-skips
6954
pytest -n auto -m "not ciSkip" -rs --error-for-skips --dist=loadscope -v
7055
if: ${{ always() }}
71-
- name: "Run C/C++ Tests"
56+
- name: Run C/C++ Tests
7257
working-directory: ./dist3
7358
run: ctest -C Release
7459
if: ${{ always() }}
75-
76-
- name: "Build Documentation"
77-
run: |
78-
source .venv/bin/activate
79-
cd docs
80-
make html SPHINXOPTS="-W"
81-
if: ${{ always() }}
82-
83-
- name: "Upload package version logs"
60+
- name: Build docs
61+
uses: ./.github/actions/docs
62+
- name: Upload package version logs
8463
if: always()
8564
uses: actions/upload-artifact@v4
8665
with:

.github/workflows/merge.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: Merge to develop
2+
3+
on:
4+
push:
5+
branches: [develop]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: write
10+
actions: read
11+
12+
concurrency:
13+
group: merge-develop
14+
cancel-in-progress: false
15+
16+
jobs:
17+
bump_version:
18+
name: Bump version (skip if already bumped)
19+
runs-on: ubuntu-latest
20+
if: ${{ github.actor != 'AVSlabBot' }}
21+
steps:
22+
- uses: actions/checkout@v4
23+
with:
24+
ref: develop
25+
fetch-depth: 0
26+
token: ${{ secrets.BOT_ACCESS_TOKEN }}
27+
28+
- name: Bump version
29+
run: ./.github/workflows/version-bumper.sh ./docs/source/bskVersion.txt
30+
31+
- name: Commit and push
32+
run: |
33+
git config user.name "AVSlabBot"
34+
git config user.email "cuavslab@gmail.com"
35+
git commit -a -m "[AUTO] Bump version number" || echo "No changes"
36+
git push || true
37+
38+
build-ubuntu-latest-wheels:
39+
name: Build ubuntu-latest wheels
40+
needs: bump_version
41+
# Allow for manual runs to generate new wheels
42+
if: ${{ always() }}
43+
runs-on: ubuntu-latest
44+
strategy:
45+
matrix:
46+
python-version: ["3.9", "3.10", "3.11"]
47+
steps:
48+
- name: Checkout code
49+
uses: actions/checkout@v4
50+
51+
- uses: ./.github/actions/build
52+
with:
53+
python-version: ${{ matrix.python-version }}
54+
build-mode: pip
55+
extra-apt: "cmake"
56+
57+
- name: Build wheel
58+
run: |
59+
python -m pip wheel . -v --wheel-dir /tmp/wheelhouse
60+
61+
- uses: actions/upload-artifact@v4
62+
with:
63+
name: basilisk-wheels_ubuntu-22.04_python${{ matrix['python-version'] }}
64+
path: /tmp/wheelhouse/**/*asilisk*.whl
65+
66+
build_documentation:
67+
name: macOS Docs Deployment
68+
needs: bump_version
69+
runs-on: macos-latest
70+
steps:
71+
- uses: actions/checkout@v4
72+
- name: Build Basilisk
73+
uses: ./.github/actions/build
74+
with:
75+
python-version: 3.13
76+
build-mode: conan
77+
conan-args: --opNav True --allOptPkg --mujoco True --mujocoReplay True --recorderPropertyRollback True
78+
- name: Build docs
79+
uses: ./.github/actions/docs
80+
- name: Deploy
81+
if: ${{ success() }} # deploy only if prior steps ok
82+
uses: peaceiris/actions-gh-pages@v3
83+
with:
84+
github_token: ${{ secrets.GITHUB_TOKEN }}
85+
publish_dir: ./docs/build/html
86+
force_orphan: true

.github/workflows/pre-commit.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: Pre-commit
2+
on:
3+
workflow_dispatch:
4+
5+
jobs:
6+
pre-commit:
7+
runs-on: ubuntu-22.04
8+
steps:
9+
- uses: actions/checkout@v4
10+
- uses: ./.github/actions/pre-commit

.github/workflows/pull-request-closed.yml

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

0 commit comments

Comments
 (0)