Skip to content

Commit

Permalink
- set the workdir /tmp for the test
Browse files Browse the repository at this point in the history
  • Loading branch information
sassman committed Nov 2, 2023
1 parent 2e161d0 commit c758b3b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
run: docker build -t test-cargo-generate .

- name: Run list
run: docker run -v ${PWD}/test:/test test-cargo-generate --path /test --name ${{ env.PROJECT_NAME }}
run: docker run -v ${PWD}/test:/test -w /test test-cargo-generate --path /test --name ${{ env.PROJECT_NAME }}

- uses: dtolnay/rust-toolchain@stable
# we need to move the generated project to a temp folder, away from the template project
Expand Down
23 changes: 5 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,16 @@ This is the name of the project being expanded.

This is the path to the repository holding the template. Defaults to `.`

### `branch`
### `arguments`

Branch for cloning the template.
All other arguments that cargo-generate accepts

### `subfolder`

Subfolder within the template repository that'll be used as the template.

### `template_values_file`

Specifies a file holding the values required for template expansion.

> NOTE: `cargo-generate` is being run with the `--silent` option, so it will fail if any values are undefined during expansion.
### `other`

This can be used to specify any other option for `cargo-generate`.
> NOTE: `cargo-generate` runs with the `--silent` option, so it will fail if any values are undefined during expansion.
Example:

```yml
other: "--define foo=\"value\" --define bar=42"
arguments: "--branch x --define foo=\"value\" --define bar=42"
```
## Example
Expand All @@ -54,10 +42,9 @@ jobs:
PROJECT_NAME: project-foo
steps:
- uses: actions/checkout@v3
- uses: cargo-generate/cargo-generate-action@v0.18
- uses: cargo-generate/cargo-generate-action@latest
with:
name: ${{ env.PROJECT_NAME }}
arguments: --branch main
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
Expand Down

0 comments on commit c758b3b

Please sign in to comment.