Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test golang SDK on PR #38

Merged
merged 4 commits into from
Oct 31, 2023
Merged
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
59 changes: 59 additions & 0 deletions .github/workflows/sdk-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -189,3 +189,62 @@ 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.21

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

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

tokuhirom marked this conversation as resolved.
Show resolved Hide resolved
- name: Show diff
run: git diff --color=always

- 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