Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

misc. ci updates #24

Merged
merged 4 commits into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 5 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,24 +1,18 @@
template_default_dir = nimble-python

test-template:
@# Check for unstaged changes, since Cruft ignores them.
@if git diff-index --quiet HEAD --; then \
echo "No uncommitted changes."; \
else \
echo "–––❌️ There are uncommitted changes, which are ignored by Cruft. –––"; \
git add .; \
git commit -m "misc."; \
git status; \
echo "I've created a new commit to include all changes. You can undo this with `git reset --soft HEAD~1`."; \
fi \


# Delete existing template
rm -rf $(template_default_dir)

# Install cruft if not already installed
pip install cruft || true
cruft create . -y

# Test the template
# Create the config file if it does not exist
mkdir -p ~/.config/gh
touch ~/.config/gh/hosts.yml
docker rm -f $(template_default_dir) || true
cd $(template_default_dir) && docker build . -t $(template_default_dir)
cd $(template_default_dir) && docker run $(template_default_dir) make validate
Expand Down
5 changes: 5 additions & 0 deletions {{cookiecutter.project_name}}/.github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ jobs:
username: ${{ {{ cookiecutter.github_user }} }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Create github hosts file
run: | # If this file is not created, the dev container fails because of non-existant mount
mkdir -p ~/.config/gh
touch ~/.config/gh/hosts.yml

- name: Pre-build dev container image
uses: devcontainers/[email protected]
with:
Expand Down
7 changes: 2 additions & 5 deletions {{cookiecutter.project_name}}/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
<a href="https://github.com/{{cookiecutter.github_user}}/{{cookiecutter.project_name}}"><img src="https://github.com/{{cookiecutter.github_user}}/{{cookiecutter.project_name}}/blob/main/docs/_static/icon.png?raw=true" width="100" align="right"/></a>

# {{ cookiecutter.friendly_name }}

[![Open in Dev Container](https://img.shields.io/static/v1?label=Dev%20Containers&message=Open&color=blue&logo=visualstudiocode)][dev container]
[![PyPI](https://img.shields.io/pypi/v/{{cookiecutter.project_name}}.svg)][pypi status]
[![Python Version](https://img.shields.io/pypi/pyversions/{{cookiecutter.project_name}})][pypi status]
[![documentation](https://github.com/{{cookiecutter.github_user}}/{{cookiecutter.project_name}}/actions/workflows/documentation.yml/badge.svg)][documentation]
[![Tests](https://github.com/{{cookiecutter.github_user}}/{{cookiecutter.project_name}}/actions/workflows/tests.yml/badge.svg)][tests]
[![Black](https://img.shields.io/badge/code%20style-black-000000.svg)][black]

[dev container]: https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/{{cookiecutter.github_user}}/{{cookiecutter.project_name}}/
[pypi status]: https://pypi.org/project/{{cookiecutter.project_name}}/
[documentation]: https://{{cookiecutter.github_user}}.github.io/{{cookiecutter.project_name}}/
[tests]: https://github.com/{{cookiecutter.github_user}}/{{cookiecutter.project_name}}/actions?workflow=Tests
[black]: https://github.com/psf/black


<!-- start short-description -->
Expand Down