-
Notifications
You must be signed in to change notification settings - Fork 5
103 lines (98 loc) · 3.83 KB
/
templates-go.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: Templates
on:
push:
branches: ["main"]
paths:
- ".github/workflows/templates-go.yaml"
- "templates/**"
pull_request:
branches: ["main"]
paths:
- ".github/workflows/templates-go.yaml"
- "templates/**"
env:
TINYGO_VERSION: "0.34.0"
GOLANGCI_VERSION: "v1.61"
WASH_VERSION: "0.37.0"
WASM_TOOLS_VERSION: "1.220.0"
WRPC_VERSION: "0.11.1"
permissions:
contents: read
jobs:
provider:
# Context: https://github.com/golangci/golangci-lint-action/blob/v6.1.1/README.md#annotations
permissions:
# Required: allow read access to the content for analysis.
contents: read
# Optional: allow write access to checks to allow the action to annotate code in the PR.
checks: write
strategy:
fail-fast: false
matrix:
template-name:
- keyvalue-inmemory
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: taiki-e/install-action@a86da1a3cb51967612c80d6dc98c5cac03a73025 # v2.47.7
with:
tool: ${{ format('wash@{0},wasm-tools@{1},wrpc@{2}', env.WASH_VERSION, env.WASM_TOOLS_VERSION, env.WRPC_VERSION) }}
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
with:
go-version-file: "templates/provider/${{ matrix.template-name }}/go.mod"
- name: wash new
working-directory: "${{ runner.temp }}"
run: |
rm -rf sample-provider || true
wash new provider --silent --path $GITHUB_WORKSPACE/templates/provider/${{ matrix.template-name }} sample-provider
- name: wash build
run: wash build
working-directory: "${{ runner.temp }}/sample-provider"
- name: Go Lint
uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6.1.1
with:
version: ${{ env.GOLANGCI_VERSION }}
working-directory: "${{ runner.temp }}/sample-provider"
- name: Go Test
run: go test -v ./...
working-directory: "${{ runner.temp }}/sample-provider"
component:
# Context: https://github.com/golangci/golangci-lint-action/blob/v6.1.1/README.md#annotations
permissions:
# Required: allow read access to the content for analysis.
contents: read
# Optional: allow write access to checks to allow the action to annotate code in the PR.
checks: write
strategy:
fail-fast: false
matrix:
template-name:
- http-hello-world
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: taiki-e/install-action@a86da1a3cb51967612c80d6dc98c5cac03a73025 # v2.47.7
with:
tool: ${{ format('wash@{0},wasm-tools@{1}', env.WASH_VERSION, env.WASM_TOOLS_VERSION) }}
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
with:
go-version-file: "templates/component/${{ matrix.template-name }}/go.mod"
- uses: acifani/setup-tinygo@b2ba42b249c7d3efdfe94166ec0f48b3191404f7 # v2.0.0
with:
tinygo-version: ${{ env.TINYGO_VERSION }}
- name: wash new
working-directory: ${{ runner.temp }}
run: |
rm -rf sample-component || true
wash new component --silent --path $GITHUB_WORKSPACE/templates/component/${{ matrix.template-name }} sample-component
- name: wash build
run: wash build
working-directory: "${{ runner.temp }}/sample-component"
- name: Go Lint
uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6.1.1
with:
version: ${{ env.GOLANGCI_VERSION }}
working-directory: "${{ runner.temp }}/sample-component"
- name: Go Test
run: go test -v ./...
working-directory: "${{ runner.temp }}/sample-component"