Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: updates to CI and the CI Examples #580

Merged
merged 6 commits into from
Dec 6, 2022
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
8 changes: 6 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@
version: 2.1
orbs:
# use Cypress orb from CircleCI registry
cypress: cypress-io/cypress@1.26.0
cypress: cypress-io/cypress@2

executors:
mac:
macos:
xcode: "10.1.0"
# Executor should have Node >= required version
xcode: "14.0.0"
win:
# copied the parameters from
# https://circleci.com/developer/orbs/orb/circleci/windows
Expand Down Expand Up @@ -187,6 +188,7 @@ workflows:
# checks out code and installs dependencies once
- cypress/install:
name: 'Linux install'
executor: cypress/base-14
post-steps:
# show Cypress cache folder and binary versions
# to check if we are caching previous binary versions
Expand All @@ -202,6 +204,7 @@ workflows:

- cypress/run:
name: 'Linux lint'
executor: cypress/base-14
requires:
- Linux install
# the previous job has already installed every dependency
Expand All @@ -220,6 +223,7 @@ workflows:
name: '3 machines'
# job will use workspace with code and dependencies
# installed by the "install" job
executor: cypress/base-14
requires:
- Linux install
record: true # record results on Cypress dashboard
Expand Down
3 changes: 0 additions & 3 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
{
"extends": [
"plugin:@cypress/dev/general",
"plugin:@cypress/dev/tests",
"plugin:mocha/recommended"
],
"plugins": [
"cypress",
"@cypress/dev",
"mocha"
],
"env": {
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
runs-on: ubuntu-18.04
name: check tests
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: testomatio/check-tests@stable
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/chrome-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ jobs:
chrome:
runs-on: ubuntu-latest
# https://github.com/cypress-io/cypress-docker-images
container: cypress/browsers:node12.18.3-chrome87-ff82
container: cypress/browsers:node14.17.6-chrome100-ff98
steps:
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v3
- name: Chrome
uses: cypress-io/github-action@v4
uses: cypress-io/github-action@v5
timeout-minutes: 10
with:
build: npm run build
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/chrome-headless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ jobs:
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v3
- name: Headless Chrome
uses: cypress-io/github-action@v4
uses: cypress-io/github-action@v5
timeout-minutes: 10
with:
build: npm run build
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/chrome.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ jobs:
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v3
- name: Chrome
uses: cypress-io/github-action@v4
uses: cypress-io/github-action@v5
timeout-minutes: 10
with:
build: npm run build
Expand Down
46 changes: 23 additions & 23 deletions .github/workflows/parallel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ jobs:
name: Install NPM and Cypress
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v3

# install a specific version of Node using
# https://github.com/actions/setup-node
- name: Use Node.js v12
uses: actions/setup-node@v1
- name: Use Node.js v14
uses: actions/setup-node@v3
with:
node-version: 12
node-version: 14

# just so we learn about available environment variables GitHub provides
- name: Print CI env variables
Expand All @@ -32,7 +32,7 @@ jobs:
# we use exact restore key to avoid NPM module snowballing
# https://glebbahmutov.com/blog/do-not-let-npm-cache-snowball/
- name: Cache central NPM modules
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ github.ref }}-${{ hashFiles('**/package-lock.json') }}
Expand All @@ -42,7 +42,7 @@ jobs:
# we use the exact restore key to avoid Cypress binary snowballing
# https://glebbahmutov.com/blog/do-not-let-cypress-cache-snowball/
- name: Cache Cypress binary
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: ~/.cache/Cypress
key: cypress-${{ runner.os }}-cypress-${{ github.ref }}-${{ hashFiles('**/package.json') }}
Expand All @@ -51,7 +51,7 @@ jobs:

# Cache local node_modules to pass to testing jobs
- name: Cache local node_modules
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ github.ref }}-${{ hashFiles('**/package-lock.json') }}
Expand All @@ -76,26 +76,26 @@ jobs:
runs-on: ubuntu-18.04
needs: install
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v3

# install a specific version of Node using
# https://github.com/actions/setup-node
- name: Use Node.js v12
uses: actions/setup-node@v1
- name: Use Node.js v14
uses: actions/setup-node@v3
with:
node-version: 12
node-version: 14

# Restore just local node_modules and the Cypress binary archives.
- name: Cache Cypress binary
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: ~/.cache/Cypress
key: cypress-${{ runner.os }}-cypress-${{ github.ref }}-${{ hashFiles('**/package.json') }}
restore-keys: |
cypress-${{ runner.os }}-cypress-${{ github.ref }}-${{ hashFiles('**/package.json') }}

- name: Cache local node_modules
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ github.ref }}-${{ hashFiles('**/package-lock.json') }}
Expand All @@ -121,7 +121,7 @@ jobs:

# Save videos and screenshots as test artifacts
# https://github.com/actions/upload-artifact
- uses: actions/upload-artifact@master
- uses: actions/upload-artifact@v3
# there might be no screenshots created when:
# - there are no test failures
# so only upload screenshots if previous step has failed
Expand All @@ -130,7 +130,7 @@ jobs:
name: screenshots
path: cypress/screenshots
# video should always be generated
- uses: actions/upload-artifact@master
- uses: actions/upload-artifact@v3
with:
name: videos
path: cypress/videos
Expand All @@ -140,26 +140,26 @@ jobs:
runs-on: ubuntu-18.04
needs: install
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v3

# install a specific version of Node using
# https://github.com/actions/setup-node
- name: Use Node.js v12
uses: actions/setup-node@v1
- name: Use Node.js v14
uses: actions/setup-node@v3
with:
node-version: 12
node-version: 14

# Restore just local node_modules and the Cypress binary archives.
- name: Cache Cypress binary
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: ~/.cache/Cypress
key: cypress-${{ runner.os }}-cypress-${{ github.ref }}-${{ hashFiles('**/package.json') }}
restore-keys: |
cypress-${{ runner.os }}-cypress-${{ github.ref }}-

- name: Cache local node_modules
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ github.ref }}-${{ hashFiles('**/package-lock.json') }}
Expand All @@ -185,7 +185,7 @@ jobs:

# Save videos and screenshots as test artifacts
# https://github.com/actions/upload-artifact
- uses: actions/upload-artifact@master
- uses: actions/upload-artifact@v3
# there might be no screenshots created when:
# - there are no test failures
# so only upload screenshots if previous step has failed
Expand All @@ -194,7 +194,7 @@ jobs:
name: screenshots
path: cypress/screenshots
# video should always be generated
- uses: actions/upload-artifact@master
- uses: actions/upload-artifact@v3
with:
name: videos
path: cypress/videos
16 changes: 8 additions & 8 deletions .github/workflows/single.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ jobs:
name: Cypress test
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v3

# install a specific version of Node using
# https://github.com/actions/setup-node
- name: Use Node.js v12
uses: actions/setup-node@v1
- name: Use Node.js v14
uses: actions/setup-node@v3
with:
node-version: 12
node-version: 14

# just so we learn about available environment variables GitHub provides
- name: Print env variables
Expand All @@ -29,15 +29,15 @@ jobs:
# workflow successfully finishes.
# See https://github.com/actions/cache
- name: Cache node modules
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-

- name: Cache Cypress binary
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: ~/.cache/Cypress
key: cypress-${{ runner.os }}-cypress-${{ hashFiles('**/package.json') }}
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:

# Save videos and screenshots as test artifacts
# https://github.com/actions/upload-artifact
- uses: actions/upload-artifact@master
- uses: actions/upload-artifact@v3
with:
name: screenshots
path: cypress/screenshots
Expand All @@ -79,7 +79,7 @@ jobs:
# so only upload screenshots if previous step has failed
if: failure()
# video should always be generated
- uses: actions/upload-artifact@master
- uses: actions/upload-artifact@v3
with:
name: videos
path: cypress/videos
12 changes: 6 additions & 6 deletions .github/workflows/using-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ jobs:
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v3
- name: Cypress run
uses: cypress-io/github-action@v4
uses: cypress-io/github-action@v5
timeout-minutes: 10
with:
build: npm run build
Expand All @@ -33,12 +33,12 @@ jobs:
machines: [1, 2, 3, 4]
steps:
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v3

# because of "record" and "parallel" parameters
# these containers will load balance all found tests among themselves
- name: run tests
uses: cypress-io/github-action@v4
uses: cypress-io/github-action@v5
timeout-minutes: 5
with:
record: true
Expand All @@ -65,12 +65,12 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v3

# because of "record" and "parallel" parameters
# these containers will load balance all found tests among themselves
- name: run tests
uses: cypress-io/github-action@v4
uses: cypress-io/github-action@v5
timeout-minutes: 10
with:
record: true
Expand Down
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ cache:

# this job installs NPM dependencies and Cypress
install:
image: cypress/base:10
image: cypress/base:latest
stage: build

script:
Expand Down
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
12
14
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ env:
- PUPPETEER_SKIP_DOWNLOAD=1

node_js:
- 12
- 18

# if using Ubuntu 16 need this library
# https://github.com/cypress-io/cypress-documentation/pull/1647
Expand Down
4 changes: 2 additions & 2 deletions azure-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ jobs:
# Job names can contain alphanumeric characters and '_', cannot start with a number
- job: Cypress_e2e_tests
pool:
vmImage: 'ubuntu-16.04'
vmImage: 'ubuntu-latest'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per actions/runner-images#3287:

Traditional 5-years support of Ubuntu 16.04 by Canonical ends in April, 2021. To keep our environment updated and secured, we will remove Ubuntu 16.04 from GitHub on September 20, 2021, and from Azure DevOps on October 18, 2021.

This failed to run: https://cypress-io.visualstudio.com/cypress-example-kitchensink/_build/results?buildId=1642&view=logs&j=d2f18934-c168-59e0-ad20-3282681c6565

strategy:
parallel: 4
steps:
- task: NodeTool@0
inputs:
versionSpec: '12.x'
versionSpec: '18.x'
displayName: 'Install Node.js'

# NPM modules and Cypress binary should be cached
Expand Down
2 changes: 1 addition & 1 deletion basic/.circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2
jobs:
test:
docker:
- image: cypress/base:10
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cypress v12 dropped node 12 support. This is an example for users. Updated to pull latest.

- image: cypress/base:latest
steps:
- checkout
# restore folders with npm dependencies and Cypress binary
Expand Down
Loading