Skip to content

Commit 74a35ec

Browse files
Update workflows to use composite actions
1 parent 39b8ffc commit 74a35ec

5 files changed

Lines changed: 218 additions & 393 deletions

File tree

.github/workflows/canary.yml

Lines changed: 19 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: "Canary Build"
22

33
on:
44
schedule:
5-
- cron: '0 0 * * 0' # Run weekly on Sunday at midnight
5+
- cron: "0 0 * * 0" # Run weekly on Sunday at midnight
66
workflow_dispatch:
77
pull_request:
88
branches:
@@ -19,70 +19,47 @@ jobs:
1919
timeout-minutes: 75
2020
strategy:
2121
matrix:
22-
python-version: [ "3.13" ]
22+
python-version: ["3.13"]
2323
steps:
2424
- name: Checkout code
2525
uses: actions/checkout@v4
2626
- name: Set up Python ${{ matrix.python-version }}
2727
uses: actions/setup-python@v5
2828
with:
2929
python-version: ${{ matrix.python-version }}
30-
31-
- name: Install Homebrew
32-
run: |
33-
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
34-
brew install swig doxygen
35-
36-
- name: "Create virtual Environment"
37-
run: python3 -m venv .venv
38-
- name: "Capture initial package versions"
30+
- name: Capture initial package versions
3931
run: |
40-
source .venv/bin/activate
4132
pip freeze > initial_versions.txt
4233
echo "Initial package versions:" >> $GITHUB_STEP_SUMMARY
4334
cat initial_versions.txt >> $GITHUB_STEP_SUMMARY
4435
echo "\n" >> $GITHUB_STEP_SUMMARY
45-
46-
- name: "Install canary requirements"
47-
run: |
48-
source .venv/bin/activate
49-
pip3 install -r .github/workflows/requirements.txt
50-
pip3 install -r .github/workflows/requirements_dev.txt
51-
pip3 install -r .github/workflows/requirements_doc.txt
52-
pip3 install pytest-error-for-skips
53-
54-
- name: "Capture final package versions"
36+
- name: Build Basilisk
37+
uses: ./.github/actions/build
38+
with:
39+
python-version: ${{ matrix.python-version }}
40+
build-mode: conan
41+
conan-args: --opNav True --allOptPkg --mujoco True --mujocoReplay True --recorderPropertyRollback True --pyPkgCanary True
42+
is-canary: true
43+
install-doc-reqs: true
44+
- name: Capture final package versions
5545
run: |
56-
source .venv/bin/activate
5746
pip freeze > final_versions.txt
5847
echo "Final package versions:" >> $GITHUB_STEP_SUMMARY
5948
cat final_versions.txt >> $GITHUB_STEP_SUMMARY
6049
echo "\n" >> $GITHUB_STEP_SUMMARY
6150
echo "Package version changes:" >> $GITHUB_STEP_SUMMARY
6251
diff -u initial_versions.txt final_versions.txt | grep -E '^[+-]' | grep -v '^+++' | grep -v '^---' >> $GITHUB_STEP_SUMMARY
63-
64-
- name: "Build basilisk with latest dependencies"
65-
run: source .venv/bin/activate && python3 conanfile.py --opNav True --allOptPkg --mujoco True --mujocoReplay True --pyPkgCanary True
66-
67-
- name: "Run Python Tests"
68-
run: |
69-
source .venv/bin/activate
70-
cd src
71-
pytest -n auto -m "not ciSkip" -rs --error-for-skips --dist=loadscope -v
52+
- name: Run Python Tests
53+
working-directory: src
54+
run: pytest -n auto -m "not ciSkip" -rs --error-for-skips --dist=loadscope -v
7255
if: ${{ always() }}
73-
- name: "Run C/C++ Tests"
56+
- name: Run C/C++ Tests
7457
working-directory: ./dist3
7558
run: ctest -C Release
7659
if: ${{ always() }}
77-
78-
- name: "Build Documentation"
79-
run: |
80-
source .venv/bin/activate
81-
cd docs
82-
make html SPHINXOPTS="-W"
83-
if: ${{ always() }}
84-
85-
- name: "Upload package version logs"
60+
- name: Build docs
61+
uses: ./.github/actions/docs
62+
- name: Upload package version logs
8663
if: always()
8764
uses: actions/upload-artifact@v4
8865
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)