-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use copier instead of cookiecutter - Better feature set - Better documentation - More polished (e.g. typed codebase) Change starting workflow into a "welcome" workflow - Pregenerated empty data file based on the tutorial - workflow reads in the datafiles using generate_inputs and prints a welcome message Allow choice of build systems. App will be immediately installable and publishable End-to-end testing of app creation, dependency installation, and initial run Validation of email address and app_name. Make app_name and version mandatory fields
- Loading branch information
Showing
44 changed files
with
1,564 additions
and
586 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -110,6 +110,33 @@ jobs: | |
if: steps.setup-python.outputs.cache-hit != 'true' | ||
run: poetry install --no-interaction --no-root --no-ansi | ||
|
||
# Build docker container needed for test | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Cache Template Testing Containers | ||
uses: actions/cache@v3 | ||
with: | ||
path: container-test-template-cache | ||
key: ${{ runner.os }}-test-template-cache-${{ hashFiles('containers/test-template/**') }}-${{ steps.setup-python.outputs.python-version }} | ||
- name: Inject container-test-template-cache into docker | ||
uses: reproducible-containers/[email protected] | ||
with: | ||
cache-source: container-test-template-cache | ||
- name: Build Docker container for cache | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: containers/test-template | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
push: false | ||
load: false | ||
tags: snakebids/test-template:${{ steps.setup-python.outputs.python-version }} | ||
platforms: linux/amd64 | ||
build-args: | | ||
PYTHON_VERSION=${{ steps.setup-python.outputs.python-version }} | ||
test: | ||
runs-on: ubuntu-latest | ||
needs: [ 'build-cache-env' ] | ||
|
@@ -153,6 +180,35 @@ jobs: | |
- name: Install dependencies | ||
if: steps.setup-python.outputs.cache-hit != 'true' | ||
run: poetry install --no-interaction --no-root --no-ansi | ||
|
||
|
||
# Build docker container needed for test | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Cache Template Testing Containers | ||
uses: actions/cache@v3 | ||
with: | ||
path: container-test-template-cache | ||
key: ${{ runner.os }}-test-template-cache-${{ hashFiles('containers/test-template/**') }}-${{ steps.setup-python.outputs.python-version }} | ||
- name: Inject container-test-template-cache into docker | ||
uses: reproducible-containers/[email protected] | ||
with: | ||
cache-source: container-test-template-cache | ||
- name: Build Docker container for cache | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: containers/test-template | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
push: false | ||
load: true | ||
tags: snakebids/test-template:${{ steps.setup-python.outputs.python-version }} | ||
platforms: linux/amd64 | ||
build-args: | | ||
PYTHON_VERSION=${{ steps.setup-python.outputs.python-version }} | ||
- name: Install library | ||
run: poetry install --no-interaction --no-ansi | ||
|
||
|
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,21 @@ | ||
ARG PYTHON_VERSION=3.11 | ||
FROM python:${PYTHON_VERSION}-slim | ||
|
||
# Install and uninstall snakebids to cache it and it's dependences | ||
RUN apt-get update && apt-get install -y gcc && \ | ||
rm -rf /var/lib/apt/lists/* && \ | ||
python -m pip install pipx && \ | ||
pipx install poetry && \ | ||
pipx install hatch && \ | ||
pipx install pdm && \ | ||
mkdir prebuild && \ | ||
cd prebuild && \ | ||
pip wheel snakebids && \ | ||
cd .. && \ | ||
rm -rf prebuild | ||
|
||
COPY ./test-template.sh /run/test-template.sh | ||
ENV PATH="/root/.local/bin:$PATH" | ||
|
||
WORKDIR /work | ||
ENTRYPOINT [ "/run/test-template.sh" ] |
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,32 @@ | ||
#!/bin/sh | ||
|
||
set -eu | ||
|
||
method="$1" | ||
script_name="$2" | ||
|
||
cp -r /app/* /work | ||
script="'${script_name}' tests/data tests/result participant -c1 --skip-bids-validation" | ||
case "$method" in | ||
"setuptools" ) | ||
python -m venv .venv | ||
.venv/bin/python -m pip install . | ||
PATH=".venv/bin:$PATH" eval "$script" | ||
;; | ||
"poetry" ) | ||
poetry install | ||
eval "poetry run $script" | ||
;; | ||
"hatch" ) | ||
hatch env create | ||
eval "hatch env run -- $script" | ||
;; | ||
"pdm" ) | ||
pdm install | ||
eval "pdm run $script" | ||
;; | ||
* ) | ||
>&2 echo "Invalid method" | ||
exit 1 | ||
;; | ||
esac |
Oops, something went wrong.