Skip to content

Commit

Permalink
Test golang SDK on PR
Browse files Browse the repository at this point in the history
  • Loading branch information
tokuhirom authored Oct 31, 2023
1 parent f9e405a commit 4bf9ada
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/sdk-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -189,3 +189,59 @@ jobs:

- name: Test Project
run: export NODE_OPTIONS=--max-old-space-size=6144; npm test

test-go:
runs-on: ubuntu-latest

steps:
- name: Checkout SDK repo
uses: actions/checkout@v4
with:
repository: 'line/line-bot-sdk-go'
submodules: recursive

- name: Update line-openapi submodule
run: |
cd line-openapi
git remote add pr-source ${{ github.event.pull_request.head.repo.clone_url }}
git fetch pr-source ${{ github.event.pull_request.head.ref }}
git checkout FETCH_HEAD
# https://github.com/line/line-bot-sdk-go/blob/master/.github/workflows/go.yml
- name: actions/setup-java@v3
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
architecture: x64

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.20

- name: Install goimports
run: go install golang.org/x/tools/cmd/goimports@latest

- name: Generate code
run: python generate-code.py

- name: run tests
run: go test ./...

- name: go vet
run: go vet $(go list ./... | grep -v /examples/)

- name: Compile example scripts
run: |
for file in $(find ./examples/ -name '*.go'); do
dir=$(dirname $file)
pushd $dir
go build -o /dev/null
popd
done

0 comments on commit 4bf9ada

Please sign in to comment.