From 879a05bf4aacb24eec82dd6b0198ff904700d14c Mon Sep 17 00:00:00 2001 From: Dan Shernicoff Date: Mon, 2 Jun 2025 16:16:28 -0400 Subject: [PATCH 1/2] Add example GitHub action workflows --- .gitignore | 2 +- .../ExampleGitHubAction.yml | 29 +++++++++++++++++++ .../ExampleGitHubActionUV.yml | 29 +++++++++++++++++++ 3 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 {{cookiecutter.project_slug}}/ExampleGitHubAction.yml create mode 100644 {{cookiecutter.project_slug}}/ExampleGitHubActionUV.yml diff --git a/.gitignore b/.gitignore index 68bc17f..ab96b1f 100644 --- a/.gitignore +++ b/.gitignore @@ -157,4 +157,4 @@ cython_debug/ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore # and can be added to the global gitignore or merged into this file. For a more nuclear # option (not recommended) you can uncomment the following to ignore the entire idea folder. -#.idea/ +.idea/* diff --git a/{{cookiecutter.project_slug}}/ExampleGitHubAction.yml b/{{cookiecutter.project_slug}}/ExampleGitHubAction.yml new file mode 100644 index 0000000..a4100d0 --- /dev/null +++ b/{{cookiecutter.project_slug}}/ExampleGitHubAction.yml @@ -0,0 +1,29 @@ +name: Build # Workflow name - this is what will appear in the "Actions" tab of the repo and the "checks" section of the PR +# To use this action you can copy this over to .github/workflows and GitHub will automatically recognize it and run when you push a change. +# This workflow assumes you are using pip to install requirements and that the requirements are in a requirements.txt file + +on: # Define the triggers that will cause the workflow to run + push: + workflow_dispatch: + repository_dispatch: + +jobs: + # Build job + build: + runs-on: ubuntu-latest # This is the VM type that will run it. + steps: # The actions that define the workflow + - uses: actions/checkout@v4 # Check out the repo + - name: Install Python + uses: actions/setup-python@v5 # Install Python + with: + python-version: "3.13" # Define the version of Python that is needed + - name: Install dependencies + run: | # Tasks to run. First update pip, then install all the requirements. + python -m pip install --upgrade pip + pip install -r requirements.txt + - name: Build the site + run: render-engine build # Render your site. + - uses: actions/upload-artifact@v4 # Upload (and therefor preserve) the rendered site. + with: + name: website + path: ./output # If you are using the default output directory this is fine, otherwise change it to the directory you are using. diff --git a/{{cookiecutter.project_slug}}/ExampleGitHubActionUV.yml b/{{cookiecutter.project_slug}}/ExampleGitHubActionUV.yml new file mode 100644 index 0000000..743bf0e --- /dev/null +++ b/{{cookiecutter.project_slug}}/ExampleGitHubActionUV.yml @@ -0,0 +1,29 @@ +name: Build # Workflow name - this is what will appear in the "Actions" tab of the repo and the "checks" section of the PR +# To use this action you can copy this over to .github/workflows and GitHub will automatically recognize it and run when you push a change. +# This workflow is for the case where you are using uv. + +on: # Define the triggers that will cause the workflow to run + push: + workflow_dispatch: + repository_dispatch: + +jobs: + # Build job + build: + runs-on: ubuntu-latest # This is the VM type that will run it. + steps: # The actions that define the workflow + - uses: actions/checkout@v4 # Check out the repo + - name: Install Python + uses: actions/setup-python@v5 # Install Python + with: + python-version: "3.13" # Define the version of Python that is needed + - name: Install dependencies + run: | # Tasks to run. First update pip, then install uv. + python -m pip install --upgrade pip + pip install uv + - name: Build the site + run: uv run render-engine build # Render your site. Calling uv run will handle all the necessary requirements. + - uses: actions/upload-artifact@v4 # Upload (and therefor preserve) the rendered site. + with: + name: website + path: ./output # If you are using the default output directory this is fine, otherwise change it to the directory you are using. From e493fa41427c610ac6438ed48ce71dff741f1416 Mon Sep 17 00:00:00 2001 From: Dan Shernicoff Date: Mon, 2 Jun 2025 17:01:09 -0400 Subject: [PATCH 2/2] Fix test --- tests/test_template.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_template.py b/tests/test_template.py index 33ea7ac..5ed7110 100644 --- a/tests/test_template.py +++ b/tests/test_template.py @@ -63,7 +63,7 @@ def test_project(project): """ # Just a basic sanity test. - assert len(list(project.iterdir())) == 4 + assert len(list(project.iterdir())) == 6 return