From e8ef02ce5770e919ef52e2e294833f3b2cf294f8 Mon Sep 17 00:00:00 2001 From: JF-Cozy Date: Tue, 13 Aug 2024 16:13:24 +0200 Subject: [PATCH] chore: Test with GA --- .github/workflows/deploy.yml | 34 ++- .gitignore | 4 - .travis.yml | 430 +++++++++++++++++------------------ package.json | 3 +- react/MuiCozyTheme/index.jsx | 4 + 5 files changed, 242 insertions(+), 233 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 240e538722..415aada42f 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -17,21 +17,31 @@ jobs: - uses: actions/setup-node@v4 with: node-version-file: '.nvmrc' - # - name: Install packages - # run: yarn install --frozen-lockfile + - name: Install packages + run: yarn install --frozen-lockfile # - name: Lint # run: yarn lint - # - name: Build JS/CSS/DOCS - # run: yarn build:all + - name: Generate Sprite and Palette + run: | + yarn makeSpriteAndPalette + ls ./react + - name: Build JS + run: yarn build + - name: Build CSS + run: yarn build:css:all + # - name: Build docs React + # run: yarn build:doc:react + # - name: Build docs KSS + # run: yarn build:doc:kss # - name: Tests without snapshots # run: yarn test:noSnapshots # - name: Tests snapshots # run: yarn test:snapshots - # # - name: Bundlemon - # # run: yarn bundlemon + # - name: Bundlemon + # run: yarn bundlemon # - name: Argos - Prepare env # run: | - # yarn add puppeteer@"21.11.0" --dev --exact + # yarn add puppeteer@"21.11.0" --dev --exact --no-lockfile # mkdir ./screenshots # - name: Argos - Create desktop screenshots # run: yarn screenshots --mode react --viewport desktop --screenshot-dir ./screenshots/reactDesktop @@ -45,8 +55,8 @@ jobs: # yarn argos:upload --parallel screenshots/reactDesktop/ --token $ARGOS_TOKEN --parallel-total 3 --parallel-nonce $GITHUB_RUN_ID-${UUID} --ignore '' # yarn argos:upload --parallel screenshots/reactMobile/ --token $ARGOS_TOKEN --parallel-total 3 --parallel-nonce $GITHUB_RUN_ID-${UUID} --ignore '' # yarn argos:upload --parallel screenshots/kss/ --token $ARGOS_TOKEN --parallel-total 3 --parallel-nonce $GITHUB_RUN_ID-${UUID} --ignore '' - # - name: Deploy - # if: ${{ github.ref_name == 'master' }} - # run: | - # yarn deploy:doc --username cozycloud --email contact@cozycloud.cc --repo https://cozy-bot:$GH_TOKEN@github.com/cozy/cozy-ui.git - # yarn semantic-release + - name: Deploy + # if: ${{ github.ref_name == 'master' }} + # yarn deploy:doc --username cozycloud --email contact@cozycloud.cc --repo https://cozy-bot:$GH_TOKEN@github.com/cozy/cozy-ui.git + # yarn semantic-release + run: yarn git-directory-deploy --directory ./ --branch build-jf --username cozycloud --email contact@cozycloud.cc --repo https://cozy-bot:$GH_TOKEN@github.com/cozy/cozy-ui.git diff --git a/.gitignore b/.gitignore index 5900d54dd4..8f154faa40 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,6 @@ node_modules package-lock.json build -dist .changelog yarn-error.log coverage @@ -20,9 +19,6 @@ Thumbs.db desktop.ini .cache -transpiled # Generated files -react/Icon/icons-sprite.js -react/palette.js /screenshots diff --git a/.travis.yml b/.travis.yml index 1836d7069c..ce981416cf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,215 +1,215 @@ -language: node_js -dist: jammy -cache: - npm: false -if: type NOT IN (pull_request) # we run CI only on branches, not PR -branches: - except: - - /^\d+\.\d+\.\d+$/ # we don't want to run CI on tag after new publication -env: - global: - - PR_TITLE=$(curl https://github.com/${TRAVIS_REPO_SLUG}/pull/${TRAVIS_PULL_REQUEST} 2> /dev/null | grep "title" | head -1) -stages: - - Install - - Prebuild - - Build - - Docs - - Test - - Screenshots - Create - - Screenshots - Upload - - Deploy -install: true -jobs: - include: - - name: 'Install node_modules' - stage: 'Install' - script: yarn install --frozen-lockfile - workspaces: - create: - name: modules - paths: - - ./node_modules - - name: 'Lint' - stage: 'Prebuild' - script: yarn lint - if: commit_message =~ /^((?!\[only argos\]).)*$/ # skipped if commit message contains "[only argos]" - workspaces: - use: - - modules - - name: 'Generate Sprite and Palette' - stage: 'Prebuild' - script: yarn makeSpriteAndPalette - workspaces: - use: - - modules - create: - name: sprite-palette-binaries - paths: - - ./react/Icon/icons-sprite.js - - ./react/palette.js - - name: 'Build JS' - stage: 'Build' - script: - - yarn build - workspaces: - use: - - modules - - sprite-palette-binaries - create: - name: js-binaries - paths: - - ./transpiled - - name: 'Build CSS' - stage: 'Build' - script: - - yarn build:css:all - workspaces: - use: - - modules - create: - name: css-binaries - paths: - - ./dist - - name: 'Build docs' - stage: 'Docs' - script: - - yarn build:doc:react - - yarn build:doc:kss - workspaces: - use: - - modules - - sprite-palette-binaries - - js-binaries - - css-binaries - create: - name: docs-binaries - paths: - - ./build - - name: 'Tests without snapshots' - stage: 'Test' - script: - - yarn test:noSnapshots - workspaces: - use: - - modules - - 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: - - modules - - 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: - - modules - - 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' - addons: - chrome: stable - script: | - if [[ "${PR_TITLE}" != *"[skip argos]"* ]]; then - mkdir ./screenshots - yarn screenshots --mode react --viewport desktop --screenshot-dir ./screenshots/reactDesktop - fi - workspaces: - use: - - modules - - sprite-palette-binaries - - js-binaries - - css-binaries - - docs-binaries - create: - name: screenshots-desktop-binaries - paths: - - ./screenshots - - name: '[Argos] Create mobile screenshots' - stage: 'Screenshots - Create' - addons: - chrome: stable - script: | - if [[ "${PR_TITLE}" != *"[skip argos]"* ]]; then - mkdir ./screenshots - yarn screenshots --mode react --viewport 300x600 --screenshot-dir ./screenshots/reactMobile - fi - workspaces: - use: - - modules - - sprite-palette-binaries - - js-binaries - - css-binaries - - docs-binaries - create: - name: screenshots-mobile-binaries - paths: - - ./screenshots - - name: '[Argos] Create kss screenshots' - stage: 'Screenshots - Create' - addons: - chrome: stable - script: | - if [[ "${PR_TITLE}" != *"[skip argos]"* ]]; then - mkdir ./screenshots - yarn screenshots --mode kss --screenshot-dir ./screenshots/kss - fi - workspaces: - use: - - modules - - 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: | - if [[ "${PR_TITLE}" != *"[skip argos]"* ]]; then - yarn argos:upload --parallel screenshots/reactDesktop/ --token $ARGOS_TOKEN --parallel-total 3 --parallel-nonce $TRAVIS_BUILD_ID --ignore '' - yarn argos:upload --parallel screenshots/reactMobile/ --token $ARGOS_TOKEN --parallel-total 3 --parallel-nonce $TRAVIS_BUILD_ID --ignore '' - yarn argos:upload --parallel screenshots/kss/ --token $ARGOS_TOKEN --parallel-total 3 --parallel-nonce $TRAVIS_BUILD_ID --ignore '' - fi - workspaces: - use: - - modules - - sprite-palette-binaries - - js-binaries - - css-binaries - - docs-binaries - - screenshots-desktop-binaries - - screenshots-mobile-binaries - - screenshots-kss-binaries - - name: 'Deploy' - stage: 'Deploy' - script: 'true' - if: commit_message =~ /^((?!\[only argos\]).)*$/ # skipped if commit message contains "[only argos]" - workspaces: - use: - - modules - - sprite-palette-binaries - - js-binaries - - css-binaries - - docs-binaries - deploy: - provider: script - skip-cleanup: true - script: yarn deploy:doc --username cozycloud --email contact@cozycloud.cc --repo https://cozy-bot:$GH_TOKEN@github.com/cozy/cozy-ui.git && yarn semantic-release - on: - branch: master +# language: node_js +# dist: jammy +# cache: +# npm: false +# if: type NOT IN (pull_request) # we run CI only on branches, not PR +# branches: +# except: +# - /^\d+\.\d+\.\d+$/ # we don't want to run CI on tag after new publication +# env: +# global: +# - PR_TITLE=$(curl https://github.com/${TRAVIS_REPO_SLUG}/pull/${TRAVIS_PULL_REQUEST} 2> /dev/null | grep "title" | head -1) +# stages: +# - Install +# - Prebuild +# - Build +# - Docs +# - Test +# - Screenshots - Create +# - Screenshots - Upload +# - Deploy +# install: true +# jobs: +# include: +# - name: 'Install node_modules' +# stage: 'Install' +# script: yarn install --frozen-lockfile +# workspaces: +# create: +# name: modules +# paths: +# - ./node_modules +# - name: 'Lint' +# stage: 'Prebuild' +# script: yarn lint +# if: commit_message =~ /^((?!\[only argos\]).)*$/ # skipped if commit message contains "[only argos]" +# workspaces: +# use: +# - modules +# - name: 'Generate Sprite and Palette' +# stage: 'Prebuild' +# script: yarn makeSpriteAndPalette +# workspaces: +# use: +# - modules +# create: +# name: sprite-palette-binaries +# paths: +# - ./react/Icon/icons-sprite.js +# - ./react/palette.js +# - name: 'Build JS' +# stage: 'Build' +# script: +# - yarn build +# workspaces: +# use: +# - modules +# - sprite-palette-binaries +# create: +# name: js-binaries +# paths: +# - ./transpiled +# - name: 'Build CSS' +# stage: 'Build' +# script: +# - yarn build:css:all +# workspaces: +# use: +# - modules +# create: +# name: css-binaries +# paths: +# - ./dist +# - name: 'Build docs' +# stage: 'Docs' +# script: +# - yarn build:doc:react +# - yarn build:doc:kss +# workspaces: +# use: +# - modules +# - sprite-palette-binaries +# - js-binaries +# - css-binaries +# create: +# name: docs-binaries +# paths: +# - ./build +# - name: 'Tests without snapshots' +# stage: 'Test' +# script: +# - yarn test:noSnapshots +# workspaces: +# use: +# - modules +# - 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: +# - modules +# - 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: +# - modules +# - 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' +# addons: +# chrome: stable +# script: | +# if [[ "${PR_TITLE}" != *"[skip argos]"* ]]; then +# mkdir ./screenshots +# yarn screenshots --mode react --viewport desktop --screenshot-dir ./screenshots/reactDesktop +# fi +# workspaces: +# use: +# - modules +# - sprite-palette-binaries +# - js-binaries +# - css-binaries +# - docs-binaries +# create: +# name: screenshots-desktop-binaries +# paths: +# - ./screenshots +# - name: '[Argos] Create mobile screenshots' +# stage: 'Screenshots - Create' +# addons: +# chrome: stable +# script: | +# if [[ "${PR_TITLE}" != *"[skip argos]"* ]]; then +# mkdir ./screenshots +# yarn screenshots --mode react --viewport 300x600 --screenshot-dir ./screenshots/reactMobile +# fi +# workspaces: +# use: +# - modules +# - sprite-palette-binaries +# - js-binaries +# - css-binaries +# - docs-binaries +# create: +# name: screenshots-mobile-binaries +# paths: +# - ./screenshots +# - name: '[Argos] Create kss screenshots' +# stage: 'Screenshots - Create' +# addons: +# chrome: stable +# script: | +# if [[ "${PR_TITLE}" != *"[skip argos]"* ]]; then +# mkdir ./screenshots +# yarn screenshots --mode kss --screenshot-dir ./screenshots/kss +# fi +# workspaces: +# use: +# - modules +# - 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: | +# if [[ "${PR_TITLE}" != *"[skip argos]"* ]]; then +# yarn argos:upload --parallel screenshots/reactDesktop/ --token $ARGOS_TOKEN --parallel-total 3 --parallel-nonce $TRAVIS_BUILD_ID --ignore '' +# yarn argos:upload --parallel screenshots/reactMobile/ --token $ARGOS_TOKEN --parallel-total 3 --parallel-nonce $TRAVIS_BUILD_ID --ignore '' +# yarn argos:upload --parallel screenshots/kss/ --token $ARGOS_TOKEN --parallel-total 3 --parallel-nonce $TRAVIS_BUILD_ID --ignore '' +# fi +# workspaces: +# use: +# - modules +# - sprite-palette-binaries +# - js-binaries +# - css-binaries +# - docs-binaries +# - screenshots-desktop-binaries +# - screenshots-mobile-binaries +# - screenshots-kss-binaries +# - name: 'Deploy' +# stage: 'Deploy' +# script: 'true' +# if: commit_message =~ /^((?!\[only argos\]).)*$/ # skipped if commit message contains "[only argos]" +# workspaces: +# use: +# - modules +# - sprite-palette-binaries +# - js-binaries +# - css-binaries +# - docs-binaries +# deploy: +# provider: script +# skip-cleanup: true +# script: yarn deploy:doc --username cozycloud --email contact@cozycloud.cc --repo https://cozy-bot:$GH_TOKEN@github.com/cozy/cozy-ui.git && yarn semantic-release +# on: +# branch: master diff --git a/package.json b/package.json index c8e7267327..c45a3af69e 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "build:doc:react": "NODE_OPTIONS=--openssl-legacy-provider styleguidist build --config docs/styleguide.config.js", "build:types": "tsc -p tsconfig-build.json", "build:all": "yarn makeSpriteAndPalette && yarn build && yarn build:css:all && yarn build:doc", - "build:js": "env BABEL_ENV=transpilation babel --extensions .ts,.tsx,.js,.jsx,.md,.styl,.json,.snap react/ --out-dir transpiled/react --copy-files --no-copy-ignored --verbose", + "build:js": "env BABEL_ENV=transpilation babel --extensions .ts,.tsx,.js,.jsx,.md,.styl,.json,.snap react/ --out-dir transpiled/react --copy-files --no-copy-ignored --verbose && postcss transpiled/react/stylesheet.css --replace", "build": "yarn build:types && yarn build:js", "clean:doc:kss": "rm -rf build/styleguide", "deploy:doc": "git-directory-deploy --directory build/ --branch gh-pages", @@ -51,7 +51,6 @@ "test:noSnapshots": "jest --testPathIgnorePatterns 'react/examples.spec.jsx'", "test:snapshots": "jest react/examples.spec.jsx", "screenshots:server": "nodemon ./scripts/pixelmatch-server/server.js -e js,hbs", - "postbuild": "postcss transpiled/react/stylesheet.css --replace", "travis-deploy-once": "travis-deploy-once", "start:css": "yarn build:css --watch", "prestart:doc": "yarn sprite", diff --git a/react/MuiCozyTheme/index.jsx b/react/MuiCozyTheme/index.jsx index 6254bc3e77..44b0ac46d7 100644 --- a/react/MuiCozyTheme/index.jsx +++ b/react/MuiCozyTheme/index.jsx @@ -4,6 +4,10 @@ import React from 'react' import { getTheme } from './theme' import { ThemeProvider } from '../styles' +console.log(' ') +console.log('🟢 BUILDED FROM GA - should be right') +console.log(' ') + const MuiCozyTheme = ({ type, variant, children }) => { const theme = getTheme(type, variant)