Skip to content

Commit

Permalink
Merge pull request #10 from asteurer/actions
Browse files Browse the repository at this point in the history
fixing bug in main application, and attempting another caching strategy
  • Loading branch information
asteurer authored Jul 12, 2024
2 parents eaf811f + 4e13526 commit af9c71d
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 5 deletions.
21 changes: 19 additions & 2 deletions .github/workflows/build-package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,25 @@ jobs:
- name: cofiguring rust toolchain version
run: rustup toolchain install stable --profile minimal

- name: setting up the cache
uses: Swatinem/rust-cache@v2
- name: cache cargo registry and git index
id: cache-cargo-registry
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('install-script.sh') }}
restore-keys: |
${{ runner.os }}-cargo-registry-
- name: cache cargo binaries
id: cache-cargo-bin
uses: actions/cache@v3
with:
path: ~/.cargo/bin
key: ${{ runner.os }}-cargo-bin-${{ hashFiles('install-script.sh') }}
restore-keys: |
${{ runner.os }}-cargo-bin-
- name: install wkg
run: cargo install --git https://github.com/bytecodealliance/wasm-pkg-tools wkg --locked --config net.git-fetch-with-cli=true
Expand Down
2 changes: 1 addition & 1 deletion infra/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ locals {

resource "azurerm_resource_group" "demo" {
name = "rg-${local.base_name}"
location = "West US 2"
location = var.location
}

resource "azurerm_storage_account" "demo" {
Expand Down
4 changes: 4 additions & 0 deletions infra/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ variable "prefix" {
type = string
}

variable "location" {
type = string
}

variable "tags" {
description = "Map of extra tags to attach to items which accept them"
type = map(string)
Expand Down
4 changes: 3 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ func init() {
return
}

uriPath := r.URL.Path
// This gets the vital portions of the uri path, while excluding the route path defined in the spin.toml file
//See https://developer.fermyon.com/spin/v2/http-trigger#additional-request-information
uriPath := r.Header.Get("spin-path-info")
queryString := r.URL.RawQuery
endpoint := fmt.Sprintf("https://%s.%s.core.windows.net", accountName, service)

Expand Down
2 changes: 1 addition & 1 deletion spin.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ az_shared_key = { required = true, secret = true }


[[trigger.http]]
route = "/azure-client/..."
route = "/..."
component = "go-azure"

[component.go-azure]
Expand Down

0 comments on commit af9c71d

Please sign in to comment.