|
3 | 3 |
|
4 | 4 | @_checks: check-spelling check-commits |
5 | 5 | # Test Seedcase and non-Seedcase projects |
6 | | -@_tests: (test "true") (test "false") |
| 6 | +@_tests: (test "true" "netlify") (test "false" "netlify") (test "true" "gh-pages") (test "false" "gh-pages") |
7 | 7 | @_builds: build-contributors build-website build-readme |
8 | 8 |
|
9 | 9 | # Run all build-related recipes in the justfile |
@@ -47,60 +47,9 @@ check-commits: |
47 | 47 | check-spelling: |
48 | 48 | uvx typos |
49 | 49 |
|
50 | | -# Test and check that a Python package can be created from the template |
51 | | -test is_seedcase_project: |
52 | | - #!/usr/bin/env bash |
53 | | - test_name="test-python-package" |
54 | | - test_dir="$(pwd)/_temp/{{ is_seedcase_project }}/$test_name" |
55 | | - template_dir="$(pwd)" |
56 | | - commit=$(git rev-parse HEAD) |
57 | | - rm -rf $test_dir |
58 | | - # vcs-ref means the current commit/head, not a tag. |
59 | | - uvx copier copy $template_dir $test_dir \ |
60 | | - --vcs-ref=$commit \ |
61 | | - --defaults \ |
62 | | - --trust \ |
63 | | - --data package_github_repo="first-last/repo" \ |
64 | | - --data is_seedcase_project={{ is_seedcase_project }} \ |
65 | | - --data author_given_name="First" \ |
66 | | - --data author_family_name="Last" \ |
67 | | - --data author_email= "[email protected]" \ |
68 | | - --data review_team="@first-last/developers" \ |
69 | | - --data github_board_number=22 |
70 | | - # Run checks in the generated test Python package |
71 | | - cd $test_dir |
72 | | - git add . |
73 | | - git commit -m "test: initial copy" |
74 | | - just check-python check-spelling |
75 | | - # TODO: Find some way to test the `update` command |
76 | | - # Check that recopy works |
77 | | - echo "Testing recopy command -----------" |
78 | | - rm .cz.toml |
79 | | - git add . |
80 | | - git commit -m "test: preparing to recopy from the template" |
81 | | - uvx copier recopy \ |
82 | | - --vcs-ref=$commit \ |
83 | | - --defaults \ |
84 | | - --overwrite \ |
85 | | - --trust |
86 | | - # Check that copying onto an existing Python package works |
87 | | - echo "Using the template in an existing package command -----------" |
88 | | - rm .cz.toml .copier-answers.yml LICENSE.md |
89 | | - git add . |
90 | | - git commit -m "test: preparing to copy onto an existing package" |
91 | | - uvx copier copy \ |
92 | | - $template_dir $test_dir \ |
93 | | - --vcs-ref=$commit \ |
94 | | - --defaults \ |
95 | | - --trust \ |
96 | | - --overwrite \ |
97 | | - --data package_github_repo="first-last/repo" \ |
98 | | - --data is_seedcase_project={{ is_seedcase_project }} \ |
99 | | - --data author_given_name="First" \ |
100 | | - --data author_family_name="Last" \ |
101 | | - --data author_email= "[email protected]" \ |
102 | | - --data review_team="@first-last/developers" \ |
103 | | - --data github_board_number=22 |
| 50 | +# Test that a Python package can be created from the template, with parameters for: `is_seedcase_project` (true or false) and `hosting_provider` (either "gh-pages" or "netlify") |
| 51 | +test is_seedcase_project="true" hosting_provider="netlify": |
| 52 | + sh ./test-template.sh {{ is_seedcase_project }} {{ hosting_provider }} |
104 | 53 |
|
105 | 54 | # Clean up any leftover and temporary build files |
106 | 55 | cleanup: |
|
0 commit comments