LINE SDK Login Tests #128
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: "LINE SDK Login Tests" | |
| on: | |
| schedule: | |
| - cron: '0 22 * * *' # Run at UTC 22:00 daily (JST 07:00) | |
| workflow_dispatch: # Allow manual trigger | |
| jobs: | |
| login_tests: | |
| name: Run Login Tests | |
| runs-on: macos-15 | |
| environment: "Login Test Env" # Use specified GitHub environment | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/cache@v4 | |
| with: | |
| path: vendor/bundle | |
| key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-gems- | |
| - name: Bundle Install | |
| run: | | |
| bundle config path vendor/bundle | |
| bundle install --jobs 4 --retry 3 | |
| - name: Run Login Tests | |
| id: run_tests | |
| env: | |
| LINE_SDK_TEST_EMAIL: ${{ secrets.LINE_SDK_TEST_EMAIL }} | |
| LINE_SDK_TEST_PASSWORD: ${{ secrets.LINE_SDK_TEST_PASSWORD }} | |
| run: | | |
| set +e # Don't exit immediately on error | |
| bundle exec fastlane sample_tests | |
| TEST_RESULT=$? | |
| echo "test_result=$TEST_RESULT" >> $GITHUB_OUTPUT | |
| exit 0 # Always continue to upload artifacts | |
| - name: Upload Test Results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-results-${{ github.run_number }} | |
| path: | | |
| test_output/*.xcresult | |
| test_output/*.xml | |
| fastlane/test_output/ | |
| retention-days: 30 | |
| if-no-files-found: ignore | |
| - name: Create Test Summary | |
| if: always() | |
| run: | | |
| echo "# π± LINE SDK Login Test Results" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| # Test execution info | |
| echo "## π Test Execution Info" >> $GITHUB_STEP_SUMMARY | |
| echo "- **Date**: $(date)" >> $GITHUB_STEP_SUMMARY | |
| echo "- **Run Number**: #${{ github.run_number }}" >> $GITHUB_STEP_SUMMARY | |
| echo "- **Triggered by**: ${{ github.event_name }}" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| # Find xcresult bundle | |
| XCRESULT=$(find test_output -name "*.xcresult" -type d 2>/dev/null | head -1) | |
| if [ ! -z "$XCRESULT" ]; then | |
| echo "## π¦ Test Results Bundle" >> $GITHUB_STEP_SUMMARY | |
| echo "Found test results bundle: \`$(basename $XCRESULT)\`" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "The xcresult bundle contains:" >> $GITHUB_STEP_SUMMARY | |
| echo "- β Complete test results" >> $GITHUB_STEP_SUMMARY | |
| echo "- πΈ Screenshots from failed tests (if any)" >> $GITHUB_STEP_SUMMARY | |
| echo "- π Detailed logs and diagnostics" >> $GITHUB_STEP_SUMMARY | |
| echo "- π Code coverage data" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "**To view results:**" >> $GITHUB_STEP_SUMMARY | |
| echo "1. Download the **test-results-${{ github.run_number }}** artifact" >> $GITHUB_STEP_SUMMARY | |
| echo "2. Open the .xcresult file in Xcode" >> $GITHUB_STEP_SUMMARY | |
| echo "3. Navigate to failed tests to see screenshots and details" >> $GITHUB_STEP_SUMMARY | |
| else | |
| echo "β οΈ No xcresult bundle found" >> $GITHUB_STEP_SUMMARY | |
| fi | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "---" >> $GITHUB_STEP_SUMMARY | |
| echo "πΎ Download the **test-results-${{ github.run_number }}** artifact to access all test data." >> $GITHUB_STEP_SUMMARY | |
| # Show test result status | |
| if [ "${{ steps.run_tests.outputs.test_result }}" != "0" ]; then | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "## β Tests Failed" >> $GITHUB_STEP_SUMMARY | |
| echo "The test suite encountered failures. Please check the test results for details." >> $GITHUB_STEP_SUMMARY | |
| fi | |
| - name: Check Test Result | |
| if: always() | |
| run: | | |
| if [ "${{ steps.run_tests.outputs.test_result }}" != "0" ]; then | |
| echo "β Tests failed with exit code: ${{ steps.run_tests.outputs.test_result }}" | |
| exit 1 | |
| else | |
| echo "β All tests passed" | |
| fi |