Skip to content

Commit

Permalink
ci: Run e2e on github actions (#519)
Browse files Browse the repository at this point in the history
Co-authored-by: hung-nguyen <[email protected]>
  • Loading branch information
tuanphamcybozu and hung-cybo authored Oct 10, 2023
1 parent 523cffc commit 7cb026e
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 2 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/test-e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: test e2e

on:
push:
branches:
- main
pull_request:

concurrency:
group: test-e2e-workflow-concurrency-group
cancel-in-progress: false

jobs:
get-running-os:
name: Get running OS
runs-on: ubuntu-latest
outputs:
os: ${{ steps.get-os.outputs.os }}
steps:
- id: get-os
run: |
if [ "${{ github.event_name }}" == "push" ]; then
echo "os=['ubuntu-latest','windows-latest','macos-latest']" >> $GITHUB_OUTPUT
elif [ "${{ github.event_name }}" == "pull_request" ]; then
echo "os=['ubuntu-latest']" >> $GITHUB_OUTPUT
fi
test-e2e:
name: Node.js ${{ matrix.os }} ${{ matrix.node-version }}
runs-on: ${{ matrix.os }}
needs: get-running-os

strategy:
max-parallel: 1
matrix:
node-version: [18.x]
os: ${{ fromJSON(needs.get-running-os.outputs.os) }}
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"
- name: Install dependencies
run: pnpm install --frozen-lockfile
- run: pnpm build
- name: Run e2e tests
env:
TEST_KINTONE_BASE_URL: ${{ secrets.TEST_KINTONE_BASE_URL }}
TEST_KINTONE_USERNAME: ${{ secrets.TEST_KINTONE_USERNAME }}
TEST_KINTONE_PASSWORD: ${{ secrets.TEST_KINTONE_PASSWORD }}
TEST_KINTONE_API_TOKEN_FOR_EXPORT: ${{ secrets.TEST_KINTONE_API_TOKEN_FOR_EXPORT }}
TEST_KINTONE_API_TOKEN_FOR_EXPORT_DELETE: ${{ secrets.TEST_KINTONE_API_TOKEN_FOR_EXPORT_DELETE }}
TEST_KINTONE_API_TOKEN_FOR_IMPORT: ${{ secrets.TEST_KINTONE_API_TOKEN_FOR_IMPORT }}
TEST_KINTONE_API_TOKEN_FOR_IMPORT_DELETE: ${{ secrets.TEST_KINTONE_API_TOKEN_FOR_IMPORT_DELETE }}
TEST_KINTONE_API_TOKEN_FOR_DELETE: ${{ secrets.TEST_KINTONE_API_TOKEN_FOR_DELETE }}
TEST_KINTONE_APP_ID_GUEST_SPACE: ${{ vars.TEST_KINTONE_APP_ID_GUEST_SPACE }}
TEST_KINTONE_APP_ID_FOR_EXPORT: ${{ vars.TEST_KINTONE_APP_ID_FOR_EXPORT }}
TEST_KINTONE_APP_ID_FOR_IMPORT: ${{ vars.TEST_KINTONE_APP_ID_FOR_IMPORT }}
TEST_KINTONE_APP_ID_FOR_DELETE: ${{ vars.TEST_KINTONE_APP_ID_FOR_DELETE }}
run: pnpm test:e2e
2 changes: 1 addition & 1 deletion features/common.feature
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Feature: common test cases
Scenario: CliKintoneTest-4 Should return the help description by --help
When I run the command with args "--help"
Then I should get the exit code is zero
And The output message should match with the pattern: "cli-kintone-(macos|win|linux) <command>"
And The output message should match with the pattern: "cli-kintone-(macos|win\.exe|linux) <command>"

Scenario: CliKintoneTest-1 Should return the error message when specifying unknown option
When I run the command with args "record export --app 1 --base-url http://example.com --foo"
Expand Down
2 changes: 1 addition & 1 deletion features/version.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ Feature: cli-kintone version command

Scenario: Should return the correct cli-kintone version when using `cli-kintone --version`
When I run the command with args "--version"
Then I should get the version formatted in "\d.\d.\d"
Then I should get the version formatted in "\d+.\d+.\d+"

0 comments on commit 7cb026e

Please sign in to comment.