-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into 130-create-musicbox-configuration-for-ts1cap…
…ram-24-reduced-mechanism
- Loading branch information
Showing
299 changed files
with
18,817 additions
and
9,490 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: CI Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
continue-on-error: true | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
|
||
runs-on: ${{ matrix.os }} | ||
steps: | ||
|
||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.9' | ||
cache: 'pip' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
- name: Install this package | ||
run: pip install -e . | ||
|
||
- name: Run pytest | ||
run: cd tests && pytest | ||
|
||
- name: Run the smoke tests | ||
run: | | ||
music_box configFile=tests/configs/analytical_config/my_config.json outputDir=tests/configs/analytical_config | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
# Build and deploy documentation to GitHub Pages | ||
name: GitHub Pages | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
env: | ||
DEFAULT_BRANCH: "release" | ||
|
||
jobs: | ||
build-and-deploy: | ||
name: Build and deploy to gh-pages | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
lfs: true | ||
|
||
- name: Debugging information | ||
run: | | ||
echo "github.ref:" ${{github.ref}} | ||
echo "github.event_name:" ${{github.event_name}} | ||
echo "github.head_ref:" ${{github.head_ref}} | ||
echo "github.base_ref:" ${{github.base_ref}} | ||
set -x | ||
git rev-parse --abbrev-ref HEAD | ||
git branch | ||
git branch -a | ||
git remote -v | ||
python -V | ||
pip list --not-required | ||
pip list | ||
# Clone and set up the old gh-pages branch | ||
- name: Clone old gh-pages | ||
if: ${{ github.event_name == 'push' }} | ||
run: | | ||
set -x | ||
git fetch | ||
( git branch gh-pages remotes/origin/gh-pages && git clone . --branch=gh-pages _gh-pages/ ) || mkdir _gh-pages | ||
rm -rf _gh-pages/.git/ | ||
mkdir -p _gh-pages/branch/ | ||
# If a push and default branch, copy build to _gh-pages/ as the "main" | ||
# deployment. | ||
- name: Build and copy documentation (default branch) | ||
if: | | ||
contains(github.event_name, 'push') && | ||
contains(github.ref, env.DEFAULT_BRANCH) | ||
run: | | ||
set -x | ||
mkdir -p _build/html/versions | ||
# create two copies of the documentation | ||
# 1. the frozen version, represented as vX.X in the version switcher | ||
docker build -t music_box -f docker/Dockerfile.docs . | ||
id=$(docker create music_box) | ||
docker cp $id:/build/docs/build/html tmpdocs | ||
docker rm -v $id | ||
version=$(sed -nr "s/^release = f'v(.+)\{suffix\}'.*$/\1/p" docs/source/conf.py) | ||
mv tmpdocs _build/html/versions/${version} | ||
# 2. stable, represented as vX.X (stable) in the version switcher | ||
# edit conf.py to produce a version string that looks like vX.X (stable) | ||
docker build -t music_box -f docker/Dockerfile.docs --build-arg SUFFIX=" (stable)" . | ||
id=$(docker create music_box) | ||
docker cp $id:/build/docs/build/html tmpdocs | ||
docker rm -v $id | ||
mv tmpdocs _build/html/versions/stable | ||
# Delete everything under _gh-pages/ that is from the | ||
# primary branch deployment. Excludes the other branches | ||
# _gh-pages/branch-* paths, and not including | ||
# _gh-pages itself. | ||
find _gh-pages/ -mindepth 1 ! -path '_gh-pages/branch*' ! -path '_gh-pages/versions*' -delete | ||
rsync -a _build/html/versions/stable/* _gh-pages/ | ||
mkdir -p _gh-pages/versions | ||
rsync -a _build/html/versions/* _gh-pages/versions | ||
# mv docs/switcher.json _gh-pages | ||
# If a push and not on default branch, then copy the build to | ||
# _gh-pages/branch/$brname (transforming '/' into '--') | ||
- name: Build and copy documentation (branch) | ||
if: | | ||
contains(github.event_name, 'push') && | ||
!contains(github.ref, env.DEFAULT_BRANCH) | ||
run: | | ||
set -x | ||
docker build -t music_box -f docker/Dockerfile.docs . | ||
id=$(docker create music_box) | ||
docker cp $id:/music-box/docs/build/html tmpdocs | ||
docker rm -v $id | ||
brname="${{github.ref}}" | ||
brname="${brname##refs/heads/}" | ||
brdir=${brname//\//--} # replace '/' with '--' | ||
rm -rf _gh-pages/branch/${brdir} | ||
rsync -a tmpdocs/ _gh-pages/branch/${brdir} | ||
# Go through each branch in _gh-pages/branch/, if it's not a | ||
# ref, then delete it. | ||
- name: Delete old feature branches | ||
if: ${{ github.event_name == 'push' }} | ||
run: | | ||
set -x | ||
for brdir in `ls _gh-pages/branch/` ; do | ||
brname=${brdir//--/\/} # replace '--' with '/' | ||
if ! git show-ref remotes/origin/$brname ; then | ||
echo "Removing $brdir" | ||
rm -r _gh-pages/branch/$brdir/ | ||
fi | ||
done | ||
# Add the .nojekyll file | ||
- name: nojekyll | ||
if: ${{ github.event_name == 'push' }} | ||
run: | | ||
touch _gh-pages/.nojekyll | ||
# Deploy | ||
# https://github.com/peaceiris/actions-gh-pages | ||
- name: Deploy | ||
uses: peaceiris/actions-gh-pages@v3 | ||
if: ${{ github.event_name == 'push' }} | ||
with: | ||
publish_branch: gh-pages | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: _gh-pages/ | ||
force_orphan: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Pep8 | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
autopep8: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: autopep8 | ||
uses: peter-evans/autopep8@v2 | ||
with: | ||
args: --recursive --in-place --aggressive --aggressive . | ||
|
||
- name: Check for changes | ||
id: check-changes | ||
run: git diff --exit-code | ||
continue-on-error: true | ||
|
||
- name: Commit and push changes | ||
# a failue of this step means changes were detected | ||
if: steps.check-changes.outcome != 'success' | ||
run: | | ||
git config --global user.name "GitHub Actions" | ||
git config --global user.email "[email protected]" | ||
git commit -am "Auto-format code using Clang-Format" || echo "No changes to commit" | ||
- name: Push changes to main-autopep8 branch | ||
if: steps.check-changes.outcome != 'success' | ||
run: git push origin HEAD:main-autopep8 | ||
|
||
- name: Create Pull Request | ||
if: steps.check-changes.outcome != 'success' | ||
uses: peter-evans/create-pull-request@v6 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
commit-message: "Auto-format code using autopep8" | ||
title: "Auto-format code by autopep8" | ||
body: "This is an auto-generated PR with fixes by autopep8." | ||
branch: main-autopep8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,49 @@ | ||
name: Create and publish a Docker image | ||
name: Publish Python Package | ||
|
||
on: | ||
push: | ||
branches: ['release'] | ||
tags: | ||
- '*' | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
workflow_dispatch: | ||
release: | ||
types: | ||
- published | ||
|
||
jobs: | ||
build-and-push-image: | ||
build_sdist: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Build SDist and Wheel | ||
run: pipx run build --sdist --wheel | ||
|
||
- name: Check metadata | ||
run: pipx run twine check dist/* | ||
|
||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: cibw-sdist | ||
path: dist/* | ||
|
||
upload_all: | ||
name: Upload release | ||
needs: [build_sdist] | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/p/acom_music_box | ||
permissions: | ||
contents: read | ||
packages: write | ||
id-token: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Log in to the Container repository | ||
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc | ||
with: | ||
context: . | ||
platforms: linux/amd64,linux/arm64,linux/arm | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.x" | ||
|
||
- uses: actions/download-artifact@v4 | ||
with: | ||
pattern: cibw-* | ||
path: dist | ||
merge-multiple: true | ||
|
||
- name: Publish package distributions to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,6 @@ CMakeFiles/ | |
doc/html/ | ||
doc/latex/ | ||
data/ | ||
__pycache__/ | ||
*.pyc | ||
dist |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.