deno.land / x / oauth4webapi@v1.2.2 / .github / workflows / browserstack.yml
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113name: Browserstack
on: push: pull_request: pull_request_target: types: - labeled schedule: - cron: '47 11 * * 1' workflow_dispatch:
jobs: unlabel: if: ${{ github.event_name == 'pull_request_target' && github.event.label.name == 'trigger-browserstack' }} runs-on: ubuntu-latest steps: - run: gh pr edit $PR --repo $REPO --remove-label "trigger-browserstack" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} PR: ${{ github.event.number }} REPO: ${{ github.event.repository.full_name }}
cert: if: ${{ !startsWith(github.event_name, 'pull_request') || (github.event_name == 'pull_request_target' && github.event.label.name == 'trigger-browserstack') }} runs-on: ubuntu-latest outputs: cache-key: ${{ steps.cache-key.outputs.value }} steps: - id: cache-key run: echo "value=letsencrypt-$(date +"%Y%m")" >> $GITHUB_OUTPUT - name: Cache letsencrypt uses: actions/cache@v3 id: cert with: path: letsencrypt key: ${{ steps.cache-key.outputs.value }} - name: Get test certificate if: ${{ steps.cert.outputs.cache-hit != 'true' }} run: | sudo snap install core sudo snap refresh core sudo snap install --classic certbot sudo snap set certbot trust-plugin-with-root=ok sudo snap install certbot-dns-route53 certbot certonly -n -m 'panva.ip@gmail.com' \ --agree-tos \ --dns-route53 \ --config-dir 'letsencrypt/config' \ --work-dir 'letsencrypt/work' \ --logs-dir 'letsencrypt/logs' \ -d oauth4webapi.panva.me env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
browserstack: needs: - cert if: ${{ !startsWith(github.event_name, 'pull_request') || (github.event_name == 'pull_request_target' && github.event.label.name == 'trigger-browserstack') }} runs-on: ubuntu-latest strategy: fail-fast: false matrix: browser: - browserstack:android - browserstack:ios - browserstack:safari steps: - name: Checkout uses: actions/checkout@v3 - name: Setup node uses: actions/setup-node@v3 with: node-version: 18 # lts/hydrogen cache: 'npm' check-latest: true - name: Cache letsencrypt id: cert uses: actions/cache@v3 with: path: letsencrypt key: ${{ needs.cert.outputs.cache-key }} - name: Abort if cert isn't cached if: ${{ steps.cert.outputs.cache-hit != 'true' }} uses: actions/github-script@v6 with: script: | core.setFailed('cert cache hit failed') - run: npm clean-install - name: BrowserStack Env Setup uses: browserstack/github-actions/setup-env@00ce173eae311a7838f80682a5fad5144c4219ad with: username: ${{ secrets.BROWSERSTACK_USERNAME }} access-key: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} build-name: 'BUILD_INFO' project-name: 'REPO_NAME' - name: Start BrowserStackLocal Tunnel uses: browserstack/github-actions/setup-local@00ce173eae311a7838f80682a5fad5144c4219ad with: local-testing: 'start' local-logging-level: 'all-logs' local-identifier: 'random' - name: Run Test Suite run: npm run tap:browsers env: BROWSER: ${{ matrix.browser }} - name: Stop BrowserStackLocal if: ${{ always() }} uses: browserstack/github-actions/setup-local@00ce173eae311a7838f80682a5fad5144c4219ad with: local-testing: 'stop'
Version Info