Skip to content

Commit

Permalink
chore: Test with Travis
Browse files Browse the repository at this point in the history
  • Loading branch information
JF-Cozy committed Aug 14, 2024
1 parent 72c8126 commit 6d7d9f1
Show file tree
Hide file tree
Showing 7 changed files with 442 additions and 65 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.20.2
18
103 changes: 52 additions & 51 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
language: node_js
dist: jammy
addons:
chrome: stable
cache:
npm: false
if: type NOT IN (pull_request)
Expand Down Expand Up @@ -30,7 +32,7 @@ jobs:
- ./react/Icon/icons-sprite.js
- ./react/palette.js
- name: 'Build JS'
stage: 'Build'
stage: 'Prebuild'
script:
- yarn build
workspaces:
Expand All @@ -41,7 +43,7 @@ jobs:
paths:
- ./transpiled
- name: 'Build CSS'
stage: 'Build'
stage: 'Prebuild'
script:
- yarn build:css:all
workspaces:
Expand All @@ -50,7 +52,7 @@ jobs:
paths:
- ./dist
- name: 'Build docs'
stage: 'Docs'
stage: 'Prebuild'
script:
- yarn build:doc:react
- yarn build:doc:kss
Expand All @@ -63,36 +65,36 @@ jobs:
name: docs-binaries
paths:
- ./build
- name: 'Tests without snapshots'
stage: 'Test'
script:
- yarn test:noSnapshots
workspaces:
use:
- sprite-palette-binaries
- js-binaries
- css-binaries
if: commit_message =~ /^((?!\[only argos\]).)*$/ # skipped if commit message contains "[only argos]"
- name: 'Tests snapshots'
stage: 'Test'
script:
- yarn test:snapshots
workspaces:
use:
- sprite-palette-binaries
- js-binaries
- css-binaries
if: commit_message =~ /^((?!\[only argos\]).)*$/ # skipped if commit message contains "[only argos]"
- name: 'Bundlemon'
stage: 'Test'
script:
- yarn bundlemon
workspaces:
use:
- sprite-palette-binaries
- js-binaries
- css-binaries
if: commit_message =~ /^((?!\[only argos\]).)*$/ # skipped if commit message contains "[only argos]"
# - name: 'Tests without snapshots'
# stage: 'Test'
# script:
# - yarn test:noSnapshots
# workspaces:
# use:
# - sprite-palette-binaries
# - js-binaries
# - css-binaries
# if: commit_message =~ /^((?!\[only argos\]).)*$/ # skipped if commit message contains "[only argos]"
# - name: 'Tests snapshots'
# stage: 'Test'
# script:
# - yarn test:snapshots
# workspaces:
# use:
# - sprite-palette-binaries
# - js-binaries
# - css-binaries
# if: commit_message =~ /^((?!\[only argos\]).)*$/ # skipped if commit message contains "[only argos]"
# - name: 'Bundlemon'
# stage: 'Test'
# script:
# - yarn bundlemon
# workspaces:
# use:
# - sprite-palette-binaries
# - js-binaries
# - css-binaries
# if: commit_message =~ /^((?!\[only argos\]).)*$/ # skipped if commit message contains "[only argos]"
# - name: '[Argos] Create desktop screenshots'
# stage: 'Screenshots - Create'
# script: |
Expand Down Expand Up @@ -129,24 +131,23 @@ jobs:
# name: screenshots-mobile-binaries
# paths:
# - ./screenshots
# - name: '[Argos] Create kss screenshots'
# stage: 'Screenshots - Create'
# script: |
# if [[ "${PR_TITLE}" != *"[skip argos]"* ]]; then
# mkdir ./screenshots
# yarn add puppeteer@"21.11.0" --dev --exact --no-lockfile
# yarn screenshots --mode kss --screenshot-dir ./screenshots/kss
# fi
# workspaces:
# use:
# - sprite-palette-binaries
# - js-binaries
# - css-binaries
# - docs-binaries
# create:
# name: screenshots-kss-binaries
# paths:
# - ./screenshots
- name: '[Argos] Create kss screenshots'
stage: 'Prebuild'
script: |
if [[ "${PR_TITLE}" != *"[skip argos]"* ]]; then
mkdir ./screenshots
yarn screenshots --mode kss --screenshot-dir ./screenshots/kss
fi
# workspaces:
# use:
# - sprite-palette-binaries
# - js-binaries
# - css-binaries
# - docs-binaries
# create:
# name: screenshots-kss-binaries
# paths:
# - ./screenshots
# - name: '[Argos] Upload all screenshots'
# stage: 'Screenshots - Upload'
# script: |
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@
"postcss-loader": "2.1.6",
"pretty": "2.0.0",
"prop-types": "15.7.2",
"puppeteer-core": "22.15.0",
"react": "16.12.0",
"react-dom": "16.12.0",
"react-hot-loader": "^4.3.11",
Expand Down
2 changes: 1 addition & 1 deletion scripts/screenshots.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const { readConfig, parseViewportArgument } = require('./screenshots/helpers')

let puppeteer
try {
puppeteer = require('puppeteer')
puppeteer = require('puppeteer-core')
} catch (e) {
console.error(e)
console.log(
Expand Down
7 changes: 6 additions & 1 deletion scripts/screenshots/prepares.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const path = require('path')
const fs = require('fs')
const { executablePath } = require('puppeteer-core')

const emptyDirectory = directory => {
for (const filename of fs.readdirSync(directory)) {
Expand Down Expand Up @@ -33,7 +34,11 @@ const prepareFS = async options => {
* Returns { browser, page }
*/
const prepareBrowser = async (puppeteer, options) => {
const browser = await puppeteer.launch({ headless: 'new' })
const browser = await puppeteer.launch({
headless: 'new',
executablePath: `/usr/bin/google-chrome`
// executablePath: `/Applications/Chromium.app/Contents/MacOS/Chromium`
})
const page = await browser.newPage()
// Put Argos in user agent
await page.setUserAgent(
Expand Down
1 change: 1 addition & 0 deletions scripts/screenshots/screenshotComponent.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const path = require('path')
const { sleep } = require('./helpers')
// const { argosScreenshot } = require('@argos-ci/puppeteer')

const rootDirectory = path.join(__dirname, '../')

Expand Down
Loading

0 comments on commit 6d7d9f1

Please sign in to comment.