Skip to content

Commit ccd6a40

Browse files
authored
Merge pull request #1 from acolombier/feat/initial-setup
feat: initial feature and project setup
2 parents 565f021 + 8e9ba22 commit ccd6a40

31 files changed

+1884
-1
lines changed

.codespellignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
demucs

.dockerignore

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
build
2+
.codespellignore
3+
dist
4+
.dockerignore
5+
Dockerfile
6+
.git
7+
.gitignore
8+
.pre-commit-config.yaml
9+
UNKNOWN.egg-info
10+
.vscode

.github/ISSUE_TEMPLATE/bug.yaml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: 🐛 Bug Report
2+
description: |
3+
Describe your problem here.
4+
labels: [bug]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Thanks for taking the time to fill out this bug report!
10+
- type: textarea
11+
id: description
12+
attributes:
13+
label: Bug Description
14+
description: Tell us what happens and what should happen instead.
15+
validations:
16+
required: true
17+
- type: input
18+
id: version
19+
attributes:
20+
label: Version
21+
description: What version of stemgen are you running?
22+
placeholder: 0.1.0, main, ...
23+
- type: input
24+
id: os
25+
attributes:
26+
label: OS
27+
description: What operating system (and distribution if you're on Linux) are you running?
28+
placeholder: Windows 11, macOS Big Sur, Ubuntu 22.04, ...
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: 🚀 Feature Request
2+
description: |
3+
What feature would you like to see added to stemgen?
4+
labels: [feature]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Thanks for taking the time to suggest a new feature!
10+
- type: textarea
11+
id: description
12+
attributes:
13+
label: Feature Description
14+
description: Describe describe your use-case, not yet supported and a possible solution.
15+
validations:
16+
required: true

.github/dependabot.yml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"

.github/labeler.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
build:
2+
- changed-files:
3+
- any-glob-to-any-file:
4+
- Dockerfile
5+
- setup.py
6+
- pyproject.toml
7+
- requirements.txt
8+
- .github/workflows/**
9+
10+
stembox:
11+
- changed-files:
12+
- any-glob-to-any-file:
13+
- stembox/**
14+
15+
stemgen:
16+
- changed-files:
17+
- any-glob-to-any-file:
18+
- stemgen/**
19+
20+
code quality:
21+
- changed-files:
22+
- any-glob-to-any-file:
23+
- .pre-commit-config.yaml
24+
- .codespellignore

.github/workflows/build.yml

+111
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow
2+
3+
name: Build
4+
5+
on:
6+
push:
7+
pull_request:
8+
9+
permissions:
10+
contents: read # to fetch code (actions/checkout)
11+
12+
env:
13+
REGISTRY_IMAGE: aclmb/stemgen
14+
15+
jobs:
16+
build:
17+
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
18+
runs-on: ubuntu-latest
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
platform:
23+
- linux/amd64
24+
- linux/arm64
25+
steps:
26+
- name: Prepare
27+
run: |
28+
platform=${{ matrix.platform }}
29+
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
30+
31+
- name: Checkout
32+
uses: actions/checkout@v4
33+
34+
- name: Docker meta
35+
id: meta
36+
uses: docker/metadata-action@v5
37+
with:
38+
images: ${{ env.REGISTRY_IMAGE }}
39+
40+
- name: Set up QEMU
41+
uses: docker/setup-qemu-action@v3
42+
43+
- name: Set up Docker Buildx
44+
uses: docker/setup-buildx-action@v3
45+
46+
- name: Login to Docker Hub
47+
uses: docker/login-action@v3
48+
with:
49+
username: ${{ secrets.DOCKERHUB_USERNAME }}
50+
password: ${{ secrets.DOCKERHUB_TOKEN }}
51+
52+
- name: Build and push by digest
53+
id: build
54+
uses: docker/build-push-action@v5
55+
with:
56+
context: .
57+
platforms: ${{ matrix.platform }}
58+
labels: ${{ steps.meta.outputs.labels }}
59+
outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true
60+
61+
- name: Export digest
62+
run: |
63+
mkdir -p /tmp/digests
64+
digest="${{ steps.build.outputs.digest }}"
65+
touch "/tmp/digests/${digest#sha256:}"
66+
67+
- name: Upload digest
68+
uses: actions/upload-artifact@v4
69+
with:
70+
name: digests-${{ env.PLATFORM_PAIR }}
71+
path: /tmp/digests/*
72+
if-no-files-found: error
73+
retention-days: 1
74+
75+
merge:
76+
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
77+
runs-on: ubuntu-latest
78+
needs:
79+
- build
80+
steps:
81+
- name: Download digests
82+
uses: actions/download-artifact@v4
83+
with:
84+
path: /tmp/digests
85+
pattern: digests-*
86+
merge-multiple: true
87+
88+
- name: Set up Docker Buildx
89+
uses: docker/setup-buildx-action@v3
90+
91+
- name: Docker meta
92+
id: meta
93+
uses: docker/metadata-action@v5
94+
with:
95+
images: ${{ env.REGISTRY_IMAGE }}
96+
97+
- name: Login to Docker Hub
98+
uses: docker/login-action@v3
99+
with:
100+
username: ${{ secrets.DOCKERHUB_USERNAME }}
101+
password: ${{ secrets.DOCKERHUB_TOKEN }}
102+
103+
- name: Create manifest list and push
104+
working-directory: /tmp/digests
105+
run: |
106+
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
107+
$(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
108+
109+
- name: Inspect image
110+
run: |
111+
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}

.github/workflows/labeler.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow
2+
#
3+
# This workflow will triage pull requests and apply a label based on the
4+
# paths that are modified in the pull request.
5+
#
6+
# To use this workflow, you will need to set up a .github/labeler.yml
7+
# file with configuration. For more information, see:
8+
# https://github.com/actions/labeler
9+
10+
name: "Pull Request Labeler"
11+
on:
12+
- pull_request_target
13+
14+
permissions:
15+
contents: read
16+
17+
jobs:
18+
triage:
19+
permissions:
20+
contents: read # for actions/labeler to determine modified files
21+
pull-requests: write # for actions/labeler to add labels to PRs
22+
runs-on: ubuntu-latest
23+
24+
steps:
25+
- uses: actions/labeler@v5.0.0
26+
with:
27+
repo-token: "${{ secrets.GITHUB_TOKEN }}"
28+
sync-labels: false

.github/workflows/pre-commit.yml

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow
2+
3+
name: pre-commit
4+
5+
on:
6+
pull_request:
7+
8+
permissions:
9+
contents: read # to fetch code (actions/checkout)
10+
11+
jobs:
12+
pre-commit:
13+
name: Detecting code style issues
14+
runs-on: ubuntu-latest
15+
# The Dockerfile for this container can be found at:
16+
# https://github.com/Holzhaus/mixxx-ci-docker
17+
container: holzhaus/mixxx-ci:20220930@sha256:c219b780280a21566111e8bd3df7a0d495922aca96a927aa1fef12b2095fa5d8
18+
steps:
19+
- name: "Check out repository"
20+
uses: actions/checkout@v4.1.5
21+
with:
22+
# Unfortunately we need the whole history and can't use a shallow clone
23+
# because the Appstream Metadata hook parses the history to find the
24+
# latest changelog modification date. Otherwise, `fetch-depth: 2` would
25+
# suffice.
26+
fetch-depth: 0
27+
28+
- name: "Add GitHub workspace as a safe directory"
29+
# Without this, git commands will fail due to mismatching permissions in
30+
# the container. See actions/runner#2033 for details.
31+
#
32+
# The actions/checkout action should already take care of this thanks to
33+
# commit actions/checkout@55fd82fc42c0cdd6f1f480dd23f60636a42f6f5c, but
34+
# it seems like that's not working properly.
35+
run: |
36+
git config --global --add safe.directory "${GITHUB_WORKSPACE}"
37+
git config --global --list
38+
39+
- name: "Detect code style issues (push)"
40+
uses: pre-commit/action@v3.0.1
41+
if: github.event_name == 'push'
42+
# There are too many files in the repo that have formatting issues. We'll
43+
# disable these checks for now when pushing directly (but still run these
44+
# on Pull Requests!).
45+
env:
46+
SKIP: clang-format,eslint,no-commit-to-branch
47+
48+
- name: "Detect code style issues (pull_request)"
49+
uses: pre-commit/action@v3.0.1
50+
if: github.event_name == 'pull_request'
51+
env:
52+
SKIP: no-commit-to-branch
53+
with:
54+
# HEAD is the not yet integrated PR merge commit +refs/pull/xxxx/merge
55+
# HEAD^1 is the PR target branch and HEAD^2 is the HEAD of the source branch
56+
extra_args: --from-ref HEAD^1 --to-ref HEAD
57+
58+
- name: "Generate patch file"
59+
if: failure()
60+
run: |
61+
git diff-index -p HEAD > "${PATCH_FILE}"
62+
[ -s "${PATCH_FILE}" ] && echo "UPLOAD_PATCH_FILE=${PATCH_FILE}" >> "${GITHUB_ENV}"
63+
shell: bash
64+
env:
65+
PATCH_FILE: pre-commit.patch
66+
67+
- name: "Upload patch artifact"
68+
if: failure() && env.UPLOAD_PATCH_FILE != null
69+
uses: actions/upload-artifact@v4.3.3
70+
with:
71+
name: ${{ env.UPLOAD_PATCH_FILE }}
72+
path: ${{ env.UPLOAD_PATCH_FILE }}
73+
74+
- name: "Upload pre-commit.log"
75+
if: failure() && env.UPLOAD_PATCH_FILE == null
76+
uses: actions/upload-artifact@v4.3.3
77+
with:
78+
name: pre-commit.log
79+
path: /github/home/.cache/pre-commit/pre-commit.log

.github/workflows/stale.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow
2+
3+
name: "Detect stale issues and pull request"
4+
on:
5+
schedule:
6+
- cron: "0 0 * * *"
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
stale:
13+
permissions:
14+
issues: write # for actions/stale to close stale issues
15+
pull-requests: write # for actions/stale to close stale PRs
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/stale@v9
19+
with:
20+
repo-token: ${{ secrets.GITHUB_TOKEN }}
21+
stale-pr-message: "This PR is marked as stale because it has been open 90 days with no activity."
22+
stale-pr-label: "stale"
23+
days-before-pr-stale: 90
24+
days-before-pr-close: -1
25+
exempt-pr-labels: "needs review"
26+
close-issue-message: "Expired for stemgen because there has been no activity for 60 days."
27+
stale-issue-label: "stale"
28+
days-before-issue-stale: 60
29+
days-before-issue-close: 0
30+
only-issue-labels: "incomplete"

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -158,3 +158,7 @@ cython_debug/
158158
# and can be added to the global gitignore or merged into this file. For a more nuclear
159159
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
160160
#.idea/
161+
162+
163+
# Project specific
164+
stembox/stembox.cpp

.pre-commit-config.yaml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.6.0
4+
hooks:
5+
- id: check-yaml
6+
- id: end-of-file-fixer
7+
- id: trailing-whitespace
8+
- id: check-merge-conflict
9+
- repo: https://github.com/pre-commit/mirrors-clang-format
10+
rev: v18.1.3
11+
hooks:
12+
- id: clang-format
13+
- repo: https://github.com/psf/black
14+
rev: 24.4.2
15+
hooks:
16+
- id: black
17+
- repo: https://github.com/python-jsonschema/check-jsonschema
18+
rev: 0.28.3
19+
hooks:
20+
- id: check-github-workflows
21+
- repo: https://github.com/pycqa/flake8
22+
rev: "7.0.0"
23+
hooks:
24+
- id: flake8
25+
files: ^tools/.*$
26+
types: [text, python]
27+
- repo: https://github.com/DavidAnson/markdownlint-cli2
28+
rev: v0.13.0
29+
hooks:
30+
- id: markdownlint-cli2
31+
- repo: https://github.com/codespell-project/codespell
32+
rev: v2.2.6
33+
hooks:
34+
- id: codespell
35+
args: [
36+
--ignore-words,
37+
.codespellignore,
38+
--write-changes
39+
]

0 commit comments

Comments
 (0)