Support mark as read by token API (#115) #237
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: SDK Test Automation | |
| on: | |
| push: | |
| pull_request: | |
| merge_group: | |
| workflow_dispatch: | |
| jobs: | |
| test-java: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| actions: read | |
| steps: | |
| - name: Checkout SDK repo | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| repository: 'line/line-bot-sdk-java' | |
| submodules: recursive | |
| - name: Update line-openapi submodule | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| path: './line-openapi' | |
| # https://github.com/line/line-bot-sdk-java/blob/master/.github/workflows/gradle.yml | |
| - name: Setup Java | |
| uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| - name: Generate code | |
| run: python3 generate-code.py | |
| - name: Show diff | |
| run: | | |
| git add . | |
| git diff --color=always --staged | |
| - name: Post PR comment | |
| if : ${{ github.event_name == 'pull_request' }} | |
| uses: ./line-openapi/.github/actions/post-comment-action | |
| with: | |
| language: java | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Execute Java SDK test | |
| run: ./gradlew build | |
| test-python: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| actions: read | |
| steps: | |
| - name: Checkout SDK repo | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| repository: 'line/line-bot-sdk-python' | |
| submodules: recursive | |
| - name: Update line-openapi submodule | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| path: './line-openapi' | |
| # https://github.com/line/line-bot-sdk-python/blob/master/.github/workflows/auto-testing.yml | |
| - name: Setup Python | |
| uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0 | |
| with: | |
| python-version: '3.11' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| if [ -f requirements-dev.txt ]; then python -m pip install -r requirements-dev.txt; fi | |
| - name: Generate code | |
| run: python3 generate-code.py | |
| - name: Show diff | |
| run: | | |
| git add . | |
| git diff --color=always --staged | |
| - name: Post PR comment | |
| if : ${{ github.event_name == 'pull_request' }} | |
| uses: ./line-openapi/.github/actions/post-comment-action | |
| with: | |
| language: python | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Test with pytest | |
| run: tox | |
| test-php: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| actions: read | |
| steps: | |
| - name: Checkout SDK repo | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| repository: 'line/line-bot-sdk-php' | |
| submodules: recursive | |
| - name: Update line-openapi submodule | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| path: './line-openapi' | |
| # https://github.com/line/line-bot-sdk-php/blob/master/.github/workflows/php-checks.yml | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@9e72090525849c5e82e596468b86eb55e9cc5401 # 2.32.0 | |
| with: | |
| php-version: '8.2' | |
| - name: Install openapi-generator-cli | |
| run: echo "OPENAPI_GENERATOR_VERSION=7.11.0" >> $GITHUB_ENV | |
| - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 | |
| id: openapi-generator-cache | |
| env: | |
| cache-name: openapi-generator-cache | |
| with: | |
| path: ~/bin/openapitools | |
| key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.OPENAPI_GENERATOR_VERSION }} | |
| - if: steps.openapi-generator-cache.outputs.cache-hit != 'true' | |
| run: | | |
| mkdir -p ~/bin/openapitools | |
| curl https://raw.githubusercontent.com/OpenAPITools/openapi-generator/master/bin/utils/openapi-generator-cli.sh > ~/bin/openapitools/openapi-generator-cli | |
| chmod u+x ~/bin/openapitools/openapi-generator-cli | |
| export PATH=$PATH:~/bin/openapitools/ | |
| OPENAPI_GENERATOR_VERSION=${{ env.OPENAPI_GENERATOR_VERSION }} openapi-generator-cli version | |
| - name: Generate code | |
| run: | | |
| export PATH=$PATH:~/bin/openapitools/ | |
| bash tools/gen-oas-client.sh | |
| - name: Get Composer Cache Directory | |
| id: composer-cache | |
| run: | | |
| echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
| - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 | |
| with: | |
| path: ${{ steps.composer-cache.outputs.dir }} | |
| key: ${{ runner.os }}-php-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-php-${{ matrix.php }}- | |
| - name: Install dependencies with Composer | |
| uses: ramsey/composer-install@a2636af0004d1c0499ffca16ac0b4cc94df70565 # 3.1.0 | |
| - name: Show diff | |
| run: | | |
| git add . | |
| git diff --color=always --staged | |
| - name: Post PR comment | |
| if : ${{ github.event_name == 'pull_request' }} | |
| uses: ./line-openapi/.github/actions/post-comment-action | |
| with: | |
| language: php | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Run unit tests | |
| run: ./vendor/bin/phpunit --test-suffix=Test.php | |
| test-nodejs: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| actions: read | |
| steps: | |
| - name: Checkout SDK repo | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| repository: 'line/line-bot-sdk-nodejs' | |
| submodules: recursive | |
| - name: Update line-openapi submodule | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| path: './line-openapi' | |
| # https://github.com/line/line-bot-sdk-nodejs/blob/master/.github/workflows/test.yml | |
| - name: Setup Java | |
| uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0 | |
| with: | |
| distribution: 'temurin' | |
| java-version: 17 | |
| architecture: x64 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0 | |
| with: | |
| node-version: '20' | |
| - name: Install Dependency | |
| run: npm ci | |
| - name: Generate code | |
| run: python3 generate-code.py | |
| - name: Show diff | |
| run: | | |
| git add . | |
| git diff --color=always --staged | |
| - name: Post PR comment | |
| if : ${{ github.event_name == 'pull_request' }} | |
| uses: ./line-openapi/.github/actions/post-comment-action | |
| with: | |
| language: nodejs | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Test Project | |
| run: export NODE_OPTIONS=--max-old-space-size=6144; npm test | |
| test-go: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| actions: read | |
| steps: | |
| - name: Checkout SDK repo | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| repository: 'line/line-bot-sdk-go' | |
| submodules: recursive | |
| - name: Update line-openapi submodule | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| path: './line-openapi' | |
| # https://github.com/line/line-bot-sdk-go/blob/master/.github/workflows/go.yml | |
| - name: Setup Java | |
| uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0 | |
| with: | |
| distribution: 'temurin' | |
| java-version: 17 | |
| architecture: x64 | |
| - name: Set up Python | |
| uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0 | |
| with: | |
| python-version: '3.x' | |
| - name: Set up Go | |
| uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 | |
| with: | |
| go-version: stable | |
| - name: Install goimports | |
| run: go install golang.org/x/tools/cmd/goimports@latest | |
| - name: Generate code | |
| run: python generate-code.py | |
| - name: Show diff | |
| run: | | |
| git add . | |
| git diff --color=always --staged | |
| - name: Post PR comment | |
| if : ${{ github.event_name == 'pull_request' }} | |
| uses: ./line-openapi/.github/actions/post-comment-action | |
| with: | |
| language: go | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| - 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 | |
| test-ruby: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| actions: read | |
| steps: | |
| - name: Checkout SDK repo | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| repository: 'line/line-bot-sdk-ruby' | |
| submodules: recursive | |
| - name: Update line-openapi submodule | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| path: './line-openapi' | |
| # https://github.com/line/line-bot-sdk-ruby/blob/master/.github/workflows/pull_request.yml | |
| - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1.229.0 | |
| with: | |
| ruby-version: 3.4 | |
| - uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1 | |
| with: | |
| distribution: 'temurin' | |
| java-version: 17 | |
| architecture: x64 | |
| - run: bundle install | |
| - name: Generate code | |
| run: python3 generate-code.py | |
| - name: Show diff | |
| run: | | |
| git add . | |
| git diff --color=always --staged | |
| - name: Post PR comment | |
| if : ${{ github.event_name == 'pull_request' }} | |
| uses: ./line-openapi/.github/actions/post-comment-action | |
| with: | |
| language: ruby | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Run tests | |
| run: bundle exec rake ci |