Skip to content

Commit f3199ff

Browse files
authored
Merge pull request #32 from fastly/joeshaw/ci-updates
2 parents 74c441b + 9392987 commit f3199ff

File tree

8 files changed

+65
-60
lines changed

8 files changed

+65
-60
lines changed

.github/actions/bootstrap-integration-test/action.yml

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,14 @@ runs:
44
using: "composite"
55
steps:
66
- run: |
7-
echo "Install Fastly CLI 5.0.0"
8-
wget https://github.com/fastly/cli/releases/download/v5.0.0/fastly_5.0.0_linux_amd64.deb
9-
sudo apt install ./fastly_5.0.0_linux_amd64.deb
7+
echo "Install Fastly CLI 8.1.2"
8+
wget https://github.com/fastly/cli/releases/download/v8.1.2/fastly_8.1.2_linux_amd64.deb
9+
sudo apt install ./fastly_8.1.2_linux_amd64.deb
1010
shell: "bash"
1111
- run: |
12-
echo "Install Viceroy 0.3.5..."
13-
wget https://github.com/fastly/Viceroy/releases/download/v0.3.5/viceroy_v0.3.5_linux-amd64.tar.gz
12+
echo "Install Viceroy 0.4.0..."
13+
wget https://github.com/fastly/Viceroy/releases/download/v0.4.0/viceroy_v0.4.0_linux-amd64.tar.gz
1414
mkdir -p $HOME/bin
15-
tar -xzf viceroy_v0.3.5_linux-amd64.tar.gz --directory $HOME/bin
15+
tar -xzf viceroy_v0.4.0_linux-amd64.tar.gz --directory $HOME/bin
1616
echo "$HOME/bin" >> $GITHUB_PATH
1717
shell: "bash"
18-
- run: |
19-
echo "Install TinyGo 0.26.0..."
20-
wget https://github.com/tinygo-org/tinygo/releases/download/v0.26.0/tinygo_0.26.0_amd64.deb
21-
echo "dd7d47bc15be3690932394faca93ac6433a309cbe2957fc71e5688e567cd6d1ce0b8bf1e92455058e4547db6a70e176af85fe1b507537966a160bf88a819a101 tinygo_0.26.0_amd64.deb" | sha512sum --check
22-
sudo dpkg -i tinygo_0.26.0_amd64.deb
23-
echo "/usr/local/tinygo/bin" >> $GITHUB_PATH
24-
shell: "bash"
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: "Install TinyGo"
2+
description: "Installs TinyGo"
3+
inputs:
4+
tinygo-version:
5+
description: "The version of TinyGo to install"
6+
required: true
7+
default: "0.27.0"
8+
runs:
9+
using: "composite"
10+
steps:
11+
- run: |
12+
echo "Install TinyGo ${{ inputs.tinygo-version }}..."
13+
wget https://github.com/tinygo-org/tinygo/releases/download/v${{ inputs.tinygo-version }}/tinygo_${{ inputs.tinygo-version }}_amd64.deb
14+
sudo dpkg -i tinygo_${{ inputs.tinygo-version }}_amd64.deb
15+
echo "/usr/local/tinygo/bin" >> $GITHUB_PATH
16+
shell: "bash"

.github/workflows/build-examples.yml

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,34 @@ name: Build Examples
22
on: [push]
33
jobs:
44
build-examples:
5+
strategy:
6+
matrix:
7+
go-version: ['1.20', '1.19']
8+
tinygo-version: ['0.27.0', '0.26.0']
9+
exclude:
10+
- go-version: '1.20'
11+
tinygo-version: '0.26.0'
512
runs-on: ubuntu-latest
613
steps:
714
- name: Checkout fastly/compute-sdk-go
815
uses: actions/checkout@v3
916
- name: Install Go
1017
uses: actions/setup-go@v3
1118
with:
12-
go-version: '1.19'
13-
- name: Install Tinygo
14-
run: |
15-
echo "Install TinyGo 0.26.0..."
16-
wget https://github.com/tinygo-org/tinygo/releases/download/v0.26.0/tinygo_0.26.0_amd64.deb
17-
echo "dd7d47bc15be3690932394faca93ac6433a309cbe2957fc71e5688e567cd6d1ce0b8bf1e92455058e4547db6a70e176af85fe1b507537966a160bf88a819a101 tinygo_0.26.0_amd64.deb" | sha512sum --check
18-
sudo dpkg -i tinygo_0.26.0_amd64.deb
19-
- name: build examples
19+
go-version: ${{ matrix.go-version }}
20+
- name: Install TinyGo
21+
uses: ./.github/actions/install-tinygo
22+
with:
23+
tinygo-version: ${{ matrix.tinygo-version }}
24+
- name: Build examples
2025
run: |
2126
for i in _examples/*; do
2227
echo ${GITHUB_WORKSPACE}/$i
2328
cd ${GITHUB_WORKSPACE}/$i && tinygo build -target=wasi
2429
done
30+
- name: Build integration tests
31+
run: |
32+
for i in _integration_tests/fixtures/*; do
33+
echo ${GITHUB_WORKSPACE}/$i
34+
cd ${GITHUB_WORKSPACE}/$i && tinygo build -target=wasi
35+
done

.github/workflows/integration-tests.yml

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,29 @@
11
name: Compute TinyGo SDK Test
22
on: [push]
33
jobs:
4-
sdktest-go-latest:
4+
sdktest:
55
runs-on: ubuntu-latest
66
concurrency:
77
group: SdkTestJob
88
cancel-in-progress: true
99
steps:
1010
- name: Checkout fastly/compute-sdk-go
1111
uses: actions/checkout@v2
12-
- uses: ./.github/actions/bootstrap-integration-test
13-
- name: Check our bootstrap dependencies were installed correctly, and in our $PATH
14-
run: |
15-
fastly version
16-
viceroy --version
17-
tinygo version
1812
- name: Install Go
1913
uses: actions/setup-go@v2
2014
with:
21-
go-version: '1.19'
22-
- name: compute-sdk-go Integration Tests Job
23-
uses: ./.github/actions/compute-sdk-test
24-
id: sdktest
15+
go-version: '1.20'
16+
- name: Install TinyGo
17+
uses: ./.github/actions/install-tinygo
2518
with:
26-
config: './_integration_tests/sdk-test-config.json'
27-
sdktest-go-previous:
28-
runs-on: ubuntu-latest
29-
needs: [sdktest-go-latest]
30-
concurrency:
31-
group: SdkTestJob
32-
cancel-in-progress: true
33-
steps:
34-
- name: Checkout fastly/compute-sdk-go
35-
uses: actions/checkout@v2
19+
tinygo-version: '0.27.0'
3620
- uses: ./.github/actions/bootstrap-integration-test
3721
- name: Check our bootstrap dependencies were installed correctly, and in our $PATH
3822
run: |
23+
go version
24+
tinygo version
3925
fastly version
4026
viceroy --version
41-
tinygo version
42-
- name: Install Go
43-
uses: actions/setup-go@v2
44-
with:
45-
go-version: '1.18'
4627
- name: compute-sdk-go Integration Tests Job
4728
uses: ./.github/actions/compute-sdk-test
4829
id: sdktest

.github/workflows/validate.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: Validate
2-
on: [push, pull_request]
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
37
jobs:
48
lint:
59
runs-on: ubuntu-latest

_app_template/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ WASM ?= bin/${NAME}.wasm
1212
PACKAGE ?= pkg/${NAME}.tar.gz
1313

1414
$(WASM): $(SOURCE) Makefile bin
15-
env GOROOT=${GOROOT} ${TINYGO} build -target=wasi -wasm-abi=generic -gc=${GC} -scheduler=${SCHEDULER} ${ARGS} -o ${WASM} ./cmd/${NAME}
15+
env GOROOT=${GOROOT} ${TINYGO} build -target=wasi -gc=${GC} -scheduler=${SCHEDULER} ${ARGS} -o ${WASM} ./cmd/${NAME}
1616

1717
${PACKAGE}: pkg ${WASM} fastly.toml
1818
${FASTLY} compute pack --wasm-binary=${WASM}

_integration_tests/fixtures/secret_store/fastly.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ name = "secret_store"
99
service_id = ""
1010

1111
[local_server]
12-
secret_store.phrases = [{key = "my_phrase", data = "sssh! don't tell anyone!"}]
12+
secret_stores.phrases = [{key = "my_phrase", data = "sssh! don't tell anyone!"}]

_integration_tests/sdk-test-config.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "Compute TinyGo SDK",
33
"modules": {
44
"hello_world" : {
5-
"build": "tinygo build -target=wasi -scheduler=asyncify -gc=leaking -wasm-abi=generic -o ./_integration_tests/fixtures/hello_world/hello_world.wasm ./_integration_tests/fixtures/hello_world && (cd ./_integration_tests/fixtures/hello_world && fastly compute pack --verbose --wasm-binary ./hello_world.wasm)",
5+
"build": "tinygo build -target=wasi -scheduler=asyncify -gc=leaking -o ./_integration_tests/fixtures/hello_world/hello_world.wasm ./_integration_tests/fixtures/hello_world && (cd ./_integration_tests/fixtures/hello_world && fastly compute pack --verbose --wasm-binary ./hello_world.wasm)",
66
"fastly_toml_path": "./_integration_tests/fixtures/hello_world/fastly.toml",
77
"wasm_path": "./_integration_tests/fixtures/hello_world/hello_world.wasm",
88
"pkg_path": "./_integration_tests/fixtures/hello_world/pkg/hello-world.tar.gz",
@@ -22,7 +22,7 @@
2222
},
2323

2424
"request_downstream" : {
25-
"build": "tinygo build -target=wasi -scheduler=asyncify -gc=leaking -wasm-abi=generic -o ./_integration_tests/fixtures/request_downstream/request_downstream.wasm ./_integration_tests/fixtures/request_downstream && (cd ./_integration_tests/fixtures/request_downstream && fastly compute pack --verbose --wasm-binary ./request_downstream.wasm)",
25+
"build": "tinygo build -target=wasi -scheduler=asyncify -gc=leaking -o ./_integration_tests/fixtures/request_downstream/request_downstream.wasm ./_integration_tests/fixtures/request_downstream && (cd ./_integration_tests/fixtures/request_downstream && fastly compute pack --verbose --wasm-binary ./request_downstream.wasm)",
2626
"fastly_toml_path": "./_integration_tests/fixtures/request_downstream/fastly.toml",
2727
"wasm_path": "./_integration_tests/fixtures/request_downstream/request_downstream.wasm",
2828
"pkg_path": "./_integration_tests/fixtures/request_downstream/pkg/request-downstream.tar.gz",
@@ -51,7 +51,7 @@
5151
},
5252

5353
"async_select" : {
54-
"build": "tinygo build -target=wasi -scheduler=asyncify -gc=leaking -wasm-abi=generic -o ./_integration_tests/fixtures/async_select/async_select.wasm ./_integration_tests/fixtures/async_select && (cd ./_integration_tests/fixtures/async_select && fastly compute pack --verbose --wasm-binary ./async_select.wasm)",
54+
"build": "tinygo build -target=wasi -scheduler=asyncify -gc=leaking -o ./_integration_tests/fixtures/async_select/async_select.wasm ./_integration_tests/fixtures/async_select && (cd ./_integration_tests/fixtures/async_select && fastly compute pack --verbose --wasm-binary ./async_select.wasm)",
5555
"fastly_toml_path": "./_integration_tests/fixtures/async_select/fastly.toml",
5656
"wasm_path": "./_integration_tests/fixtures/async_select/async_select.wasm",
5757
"pkg_path": "./_integration_tests/fixtures/async_select/pkg/async-select.tar.gz",
@@ -75,7 +75,7 @@
7575
},
7676

7777
"byte_repeater" : {
78-
"build": "tinygo build -target=wasi -scheduler=asyncify -gc=leaking -wasm-abi=generic -o ./_integration_tests/fixtures/byte_repeater/byte_repeater.wasm ./_integration_tests/fixtures/byte_repeater && (cd ./_integration_tests/fixtures/byte_repeater && fastly compute pack --verbose --wasm-binary ./byte_repeater.wasm)",
78+
"build": "tinygo build -target=wasi -scheduler=asyncify -gc=leaking -o ./_integration_tests/fixtures/byte_repeater/byte_repeater.wasm ./_integration_tests/fixtures/byte_repeater && (cd ./_integration_tests/fixtures/byte_repeater && fastly compute pack --verbose --wasm-binary ./byte_repeater.wasm)",
7979
"fastly_toml_path": "./_integration_tests/fixtures/byte_repeater/fastly.toml",
8080
"wasm_path": "./_integration_tests/fixtures/byte_repeater/byte_repeater.wasm",
8181
"pkg_path": "./_integration_tests/fixtures/byte_repeater/pkg/byte-repeater.tar.gz",
@@ -99,7 +99,7 @@
9999

100100

101101
"configstore" : {
102-
"build": "tinygo build -target=wasi -scheduler=asyncify -gc=leaking -wasm-abi=generic -o ./_integration_tests/fixtures/configstore/configstore.wasm ./_integration_tests/fixtures/configstore && (cd ./_integration_tests/fixtures/configstore && fastly compute pack --verbose --wasm-binary ./configstore.wasm)",
102+
"build": "tinygo build -target=wasi -scheduler=asyncify -gc=leaking -o ./_integration_tests/fixtures/configstore/configstore.wasm ./_integration_tests/fixtures/configstore && (cd ./_integration_tests/fixtures/configstore && fastly compute pack --verbose --wasm-binary ./configstore.wasm)",
103103
"fastly_toml_path": "./_integration_tests/fixtures/configstore/fastly.toml",
104104
"wasm_path": "./_integration_tests/fixtures/configstore/configstore.wasm",
105105
"pkg_path": "./_integration_tests/fixtures/configstore/pkg/configstore.tar.gz",
@@ -120,7 +120,7 @@
120120
},
121121

122122
"request_upstream" : {
123-
"build": "tinygo build -target=wasi -scheduler=asyncify -gc=leaking -wasm-abi=generic -o ./_integration_tests/fixtures/request_upstream/request_upstream.wasm ./_integration_tests/fixtures/request_upstream && (cd ./_integration_tests/fixtures/request_upstream && fastly compute pack --verbose --wasm-binary ./request_upstream.wasm)",
123+
"build": "tinygo build -target=wasi -scheduler=asyncify -gc=leaking -o ./_integration_tests/fixtures/request_upstream/request_upstream.wasm ./_integration_tests/fixtures/request_upstream && (cd ./_integration_tests/fixtures/request_upstream && fastly compute pack --verbose --wasm-binary ./request_upstream.wasm)",
124124
"fastly_toml_path": "./_integration_tests/fixtures/request_upstream/fastly.toml",
125125
"wasm_path": "./_integration_tests/fixtures/request_upstream/request_upstream.wasm",
126126
"pkg_path": "./_integration_tests/fixtures/request_upstream/pkg/request-upstream.tar.gz",
@@ -144,7 +144,7 @@
144144
},
145145

146146
"rtlog" : {
147-
"build": "tinygo build -target=wasi -scheduler=asyncify -gc=leaking -wasm-abi=generic -o ./_integration_tests/fixtures/rtlog/rtlog.wasm ./_integration_tests/fixtures/rtlog && (cd ./_integration_tests/fixtures/rtlog && fastly compute pack --verbose --wasm-binary ./rtlog.wasm)",
147+
"build": "tinygo build -target=wasi -scheduler=asyncify -gc=leaking -o ./_integration_tests/fixtures/rtlog/rtlog.wasm ./_integration_tests/fixtures/rtlog && (cd ./_integration_tests/fixtures/rtlog && fastly compute pack --verbose --wasm-binary ./rtlog.wasm)",
148148
"fastly_toml_path": "./_integration_tests/fixtures/rtlog/fastly.toml",
149149
"wasm_path": "./_integration_tests/fixtures/rtlog/rtlog.wasm",
150150
"pkg_path": "./_integration_tests/fixtures/rtlog/pkg/rtlog.tar.gz",
@@ -168,7 +168,7 @@
168168
},
169169

170170
"status" : {
171-
"build": "tinygo build -target=wasi -scheduler=asyncify -gc=leaking -wasm-abi=generic -o ./_integration_tests/fixtures/status/status.wasm ./_integration_tests/fixtures/status && (cd ./_integration_tests/fixtures/status && fastly compute pack --verbose --wasm-binary ./status.wasm)",
171+
"build": "tinygo build -target=wasi -scheduler=asyncify -gc=leaking -o ./_integration_tests/fixtures/status/status.wasm ./_integration_tests/fixtures/status && (cd ./_integration_tests/fixtures/status && fastly compute pack --verbose --wasm-binary ./status.wasm)",
172172
"fastly_toml_path": "./_integration_tests/fixtures/status/fastly.toml",
173173
"wasm_path": "./_integration_tests/fixtures/status/status.wasm",
174174
"pkg_path": "./_integration_tests/fixtures/status/pkg/status.tar.gz",
@@ -188,7 +188,7 @@
188188
},
189189

190190
"streaming_close" : {
191-
"build": "tinygo build -target=wasi -scheduler=asyncify -gc=leaking -wasm-abi=generic -o ./_integration_tests/fixtures/streaming_close/streaming_close.wasm ./_integration_tests/fixtures/streaming_close && (cd ./_integration_tests/fixtures/streaming_close && fastly compute pack --verbose --wasm-binary ./streaming_close.wasm)",
191+
"build": "tinygo build -target=wasi -scheduler=asyncify -gc=leaking -o ./_integration_tests/fixtures/streaming_close/streaming_close.wasm ./_integration_tests/fixtures/streaming_close && (cd ./_integration_tests/fixtures/streaming_close && fastly compute pack --verbose --wasm-binary ./streaming_close.wasm)",
192192
"fastly_toml_path": "./_integration_tests/fixtures/streaming_close/fastly.toml",
193193
"wasm_path": "./_integration_tests/fixtures/streaming_close/streaming_close.wasm",
194194
"pkg_path": "./_integration_tests/fixtures/streaming_close/pkg/streaming-close.tar.gz",
@@ -221,7 +221,7 @@
221221
},
222222

223223
"secret_store" : {
224-
"build": "tinygo build -target=wasi -scheduler=asyncify -gc=leaking -wasm-abi=generic -o ./_integration_tests/fixtures/secret_store/secret_store.wasm ./_integration_tests/fixtures/secret_store && (cd ./_integration_tests/fixtures/secret_store && fastly compute pack --verbose --wasm-binary ./secret_store.wasm)",
224+
"build": "tinygo build -target=wasi -scheduler=asyncify -gc=leaking -o ./_integration_tests/fixtures/secret_store/secret_store.wasm ./_integration_tests/fixtures/secret_store && (cd ./_integration_tests/fixtures/secret_store && fastly compute pack --verbose --wasm-binary ./secret_store.wasm)",
225225
"fastly_toml_path": "./_integration_tests/fixtures/secret_store/fastly.toml",
226226
"wasm_path": "./_integration_tests/fixtures/secret_store/secret_store.wasm",
227227
"pkg_path": "./_integration_tests/fixtures/secret_store/pkg/secret-store.tar.gz",

0 commit comments

Comments
 (0)