Skip to content

Commit

Permalink
Add Semaphore config
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardofaria committed Jul 28, 2020
1 parent 702b600 commit af82b7d
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
33 changes: 33 additions & 0 deletions .semaphore/semaphore.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
version: v1.0
name: Cypress example
agent:
machine:
type: e1-standard-2
os_image: ubuntu1804
blocks:
- name: Build Dependencies
dependencies: []
task:
jobs:
- name: NPM
commands:
- sem-version node latest
- checkout
- cache restore node-modules-$(checksum package-lock.json),node-modules-$SEMAPHORE_GIT_BRANCH,node-modules
- cache restore cache-$(checksum package-lock.json),cache-$SEMAPHORE_GIT_BRANCH,cache
- npm ci
- cache store node-modules-$(checksum package-lock.json) node_modules
- cache store cache-$(checksum package-lock.json) ~/.cache
- name: Tests
dependencies: ['Build Dependencies']
task:
prologue:
commands:
- sem-version node latest
- checkout
- cache restore node-modules-$SEMAPHORE_GIT_BRANCH-$(checksum package-lock.json),node-modules-$SEMAPHORE_GIT_BRANCH,node-modules
jobs:
- name: Cypress
commands:
- export CYPRESS_baseUrl="http://$(ip route | grep -E '(default|docker0)' | grep -Eo '([0-9]+\.){3}[0-9]+' | tail -1):5000"
- npm run test:ci
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"main": "index.js",
"scripts": {
"serve": "serve public -p 8000",
"test": "docker run -it -e CYPRESS_updateSnapshots=$CYPRESS_updateSnapshots --ipc=host -v $PWD:/e2e -w /e2e cypress/included:4.11.0"
"test": "docker run -it -e CYPRESS_updateSnapshots=$CYPRESS_updateSnapshots --ipc=host -v $PWD:/e2e -w /e2e cypress/included:4.11.0",
"test:ci": "start-server-and-test serve http://localhost:8000 test"
},
"keywords": [
"cypress",
Expand Down

0 comments on commit af82b7d

Please sign in to comment.