Skip to content
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
28 changes: 28 additions & 0 deletions .github/actions/end-to-end/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: End-to-end Test
description: End-to-end test for templates
inputs:
name:
description: The directory name of the template
required: true

runs:
using: composite
steps:
- uses: cachix/install-nix-action@v31
- name: Run end-to-end tests in nix environment
shell: nix shell nixpkgs#direnv --quiet --command bash {0}
run: |
# Create a directory for testing.
temp_dir="end-to-end"
mkdir "$temp_dir" && cd "$temp_dir"
# Download the template files.
echo "# ----- nix flake init ----- #"
nix flake init --template github:whisperpine/dev-templates#${{ inputs.name }}
# Track the "flake.nix" file by git.
git -C "$GITHUB_WORKSPACE" add "$temp_dir/flake.nix"
# Test the "nix develop" command.
echo "# ----- nix develop ----- #"
nix develop --quiet
# Test the "direnv allow" command.
echo "# ----- direnv allow ----- #"
direnv allow . && eval "$(direnv hook bash)"
52 changes: 52 additions & 0 deletions .github/workflows/end-to-end.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: End to End

on:
pull_request:
push:
branches: ["main"]

jobs:
template-empty:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Run end-to-end tests in nix environment
uses: ./.github/actions/end-to-end
with:
name: empty

template-golang:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Run end-to-end tests in nix environment
uses: ./.github/actions/end-to-end
with:
name: golang

template-python:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Run end-to-end tests in nix environment
uses: ./.github/actions/end-to-end
with:
name: python

template-rust:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Run end-to-end tests in nix environment
uses: ./.github/actions/end-to-end
with:
name: rust

template-web:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Run end-to-end tests in nix environment
uses: ./.github/actions/end-to-end
with:
name: web