Skip to content
Merged
Show file tree
Hide file tree
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
28 changes: 20 additions & 8 deletions .github/workflows/example-wait-on.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: example-wait-on
on: [push]
jobs:
wait:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -15,7 +15,7 @@ jobs:
wait-on: 'http://localhost:3050'

wait2:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -28,7 +28,7 @@ jobs:
wait-on: 'http://localhost:3050'

wait3:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -40,7 +40,7 @@ jobs:
wait-on: 'http://localhost:3050'

wait4:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -52,7 +52,7 @@ jobs:
wait-on: 'http://localhost:3050'

wait-multiple:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -66,7 +66,7 @@ jobs:
wait-on: 'http://localhost:3050, http://localhost:3060, http://localhost:3070'

wait-on-react-scripts:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -78,7 +78,7 @@ jobs:
wait-on: 'http://localhost:3000'

wait-using-custom-command:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -91,11 +91,23 @@ jobs:
wait-on: 'npx wait-on --timeout 5000 http://localhost:3000'

ping-cli:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install dependencies
uses: bahmutov/npm-install@v1
- name: Run ping from CLI
run: node src/ping-cli https://example.cypress.io

wait-on-vite:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Cypress tests
uses: ./
with:
working-directory: examples/wait-on-vite
start: npm start
wait-on: 'http://localhost:3000'
6 changes: 6 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -84758,11 +84758,17 @@ const ping = (url, timeout) => {

const start = +new Date()
return got(url, {
headers: {
Accept: 'text/html, application/json, text/plain, */*'
},
timeout: individualPingTimeout,
errorCodes,
retry: {
limit,
calculateDelay({ error, attemptCount }) {
if (error) {
core.debug(`got error ${JSON.stringify(error)}`)
}
const now = +new Date()
const elapsed = now - start
core.debug(
Expand Down
3 changes: 3 additions & 0 deletions examples/wait-on-vite/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# example: wait-on-vite

This example confirms our action can wait for [Vite.js](https://vitejs.dev/) to respond.
6 changes: 6 additions & 0 deletions examples/wait-on-vite/cypress.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"fixturesFolder": false,
"supportFile": false,
"pluginsFile": false,
"baseUrl": "http://localhost:3000"
}
7 changes: 7 additions & 0 deletions examples/wait-on-vite/cypress/integration/spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/// <reference types="cypress" />
describe('example: wait-on-vite', () => {
it('loads', () => {
cy.visit('/')
cy.contains('h1', 'Hello Vite!').should('be.visible')
})
})
15 changes: 15 additions & 0 deletions examples/wait-on-vite/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions examples/wait-on-vite/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite App</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/main.js"></script>
</body>
</html>
6 changes: 6 additions & 0 deletions examples/wait-on-vite/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import './style.css'

document.querySelector('#app').innerHTML = `
<h1>Hello Vite!</h1>
<a href="https://vitejs.dev/guide/features.html" target="_blank">Documentation</a>
`
Loading