Skip to content
Open
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
9 changes: 9 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ jobs:
- name: Install Rust stable
run: rustup update stable && rustup default stable && rustup component add clippy rustfmt

- name: Install tools for compute-static tests
uses: taiki-e/install-action@493d7f216ecab2af0602481ce809ab2c72836fa1 # v2.62.62
with:
tool: cargo-nextest,viceroy

- name: Run rustfmt
run: cargo fmt --all -- --check

Expand All @@ -23,6 +28,10 @@ jobs:
- name: Run clippy
run: cargo clippy --all -- -Dwarnings

- name: Run compute-static tests
working-directory: terragrunt/modules/crates-io/compute-static
run: cargo nextest run

terraform:
name: Terraform configuration
runs-on: ubuntu-24.04
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
[build]
target = "wasm32-wasi"
target = "wasm32-wasip1"

[target.wasm32-wasip1]
runner = "viceroy run -C fastly.toml -- "
78 changes: 48 additions & 30 deletions terragrunt/modules/crates-io/compute-static/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 26 additions & 1 deletion terragrunt/modules/crates-io/compute-static/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,38 @@ responses.

## Development

Build the function:
Install the Fastly CLI from [here](https://www.fastly.com/documentation/reference/tools/cli/#installing).

Then, build the function:

```shell
cd compute-static
fastly compute build
```

## Testing

Testing requires [cargo-nextest](https://nexte.st/docs/installation/pre-built-binaries/), as specified in
the [Fastly documentation](https://www.fastly.com/documentation/guides/compute/developer-guides/rust/). You can install
it from source with binstall:

```shell
cargo install cargo-binstall
cargo binstall cargo-nextest --secure
```

Then, install [Viceroy](https://github.com/fastly/Viceroy) to run the edge function locally:

```shell
cargo install --locked viceroy
```

Finally, run the tests:

```shell
cargo nextest run
```

## Deployment

Terraform uses an [external data source] to build the function as part of its
Expand Down
Loading