Skip to content

Commit

Permalink
Merge branch 'main' into refactor/update-components-to-use-prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
joshblack authored Mar 18, 2022
2 parents 8081bc7 + 8bdb534 commit 0278575
Show file tree
Hide file tree
Showing 113 changed files with 1,361 additions and 635 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: 'codeql'

on:
push:
branches: [main]
branches: [main, v10]
pull_request:
branches: [main]
branches: [main, v10]
schedule:
- cron: '0 12 * * 1'

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/deploy-react-storybook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
# Ignore tags that use a preid after `vX.Y.Z`, for example: vX.Y.Z-alpha.0
# https://help.github.com/en/articles/workflow-syntax-for-github-actions#example-using-positive-and-negative-patterns
- '!v[0-9]+.[0-9]+.[0-9]+-*'
- '!v10*'

jobs:
build:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
tags:
# Push events to matching v*, i.e. v1.0, v20.15.10
- 'v*'
# Ignore tags for v10, there is a separate v10-release.yml workflow for v10
- '!v10*'

jobs:
build:
Expand Down
122 changes: 122 additions & 0 deletions .github/workflows/v10-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
name: v10 - ci
on:
push:
branches:
- v10
pull_request:
branches:
- v10
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
dedupe:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: v10
- name: Use Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: '16.x'
- name: Run yarn dedupe
run: yarn dedupe --check

format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: v10
- name: Use Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: '16.x'
- name: Install dependencies
run: yarn install --immutable --immutable-cache
- name: Check formatting of project files
run: yarn format:diff

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: v10
- name: Use Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: '16.x'
- name: Install dependencies
run: yarn install --immutable --immutable-cache
- name: Lint JavaScript files
run: yarn lint
- name: Lint Sass files
run: yarn lint:styles

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: v10
- name: Use Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: '16.x'
- uses: actions/[email protected]
id: cache
with:
path: |
node_modules
*/**/node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
- name: Install dependencies
run: yarn install --immutable --immutable-cache
- name: Build project
run: yarn build --ignore '@carbon/sketch'
- name: Check generated styles
run: |
yarn carbon-cli check --ignore '**/@(node_modules|examples|components|react|fixtures|compat)/**' 'packages/**/*.scss'
- name: Run tests
run: yarn test --ci

e2e:
name: 'test:e2e'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: v10
- name: Use Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: '16.x'
- uses: actions/[email protected]
id: cache
with:
path: |
node_modules
*/**/node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
- name: Install dependencies
run: yarn install --immutable --immutable-cache
- uses: dorny/[email protected]
id: filter
with:
filters: |
e2e:
- 'e2e/**'
- 'packages/icons/**'
- 'packages/icons-react/**'
- 'packages/icons-vue/**'
- 'packages/pictograms/**'
- 'packages/pictograms-react/**'
- 'packages/icon-build-helpers/**'
- name: Build project
if: ${{ steps.filter.outputs.e2e == 'true' }}
run: yarn build --ignore '@carbon/sketch'
- name: Run e2e tests
if: ${{ steps.filter.outputs.e2e == 'true' }}
run: yarn test:e2e
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
name: Deploy vanilla devenv to IBM Cloud
name: v10 - Deploy React storybook to IBM Cloud

on:
workflow_dispatch:
push:
tags:
# Matches tags that have the shape `vX.Y.Z`. Reference:
# Matches tags that have the shape `v10.Y.Z`. Reference:
# https://help.github.com/en/articles/workflow-syntax-for-github-actions#onpushpull_requesttagsbranches
- 'v[0-9]+.[0-9]+.[0-9]+'
- 'v10.[0-9]+.[0-9]+'

# Ignore tags that use a preid after `vX.Y.Z`, for example: vX.Y.Z-alpha.0
# https://help.github.com/en/articles/workflow-syntax-for-github-actions#example-using-positive-and-negative-patterns
Expand All @@ -15,13 +16,15 @@ jobs:
build:
runs-on: macOS-latest
steps:
- uses: actions/checkout@main
- uses: actions/checkout@v3
with:
ref: v10
- name: Use Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: '16.x'
- name: Install dependencies
run: yarn install --immutable --immutable-cache --check-cache
run: yarn install --immutable --immutable-cache
- name: Build project
run: yarn build
- name: Install ibmcloud CLI
Expand All @@ -37,14 +40,13 @@ jobs:
ibmcloud target -o 'carbon-design-system' -s 'production'
- name: Install IBM Cloud plugins
run: |
# We use v6.50.0 as v6.51.0 and v6.52.0 have a bug where we are unable to set
# the CF API
ibmcloud cf install -v 6.50.0
ibmcloud cf install
ibmcloud cf add-plugin-repo CF-Community https://plugins.cloudfoundry.org
ibmcloud cf install-plugin blue-green-deploy -f -r CF-Community
- name: Deploy vanilla devenv
- name: Deploy React storybook
run: |
cd packages/components
ibmcloud cf blue-green-deploy carbon-dev-environment \
cd packages/react
yarn build-storybook
ibmcloud cf blue-green-deploy carbon-storybook \
-f manifest.yml \
--delete-old-apps
63 changes: 63 additions & 0 deletions .github/workflows/v10-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: v10 - Release

on:
push:
tags:
# Push events to matching v10*, i.e. v10.55.0, v10.55.1
- 'v10*'

jobs:
build:
name: Create Release
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v3
with:
ref: v10

- name: Use Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: yarn install --immutable --immutable-cache --check-cache

- name: Build project
run: yarn build

- name: Run Continuous Integration checks
run: yarn ci-check

- name: Publish packages under the `next` dist tag
run: yarn lerna publish from-package --dist-tag next --yes
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Prepare artifacts for release
run: |
zip -r --junk-paths carbon-elements.sketchplugin.zip packages/sketch/carbon-elements.sketchplugin
- name: Create Release
id: create_release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: true

- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./carbon-elements.sketchplugin.zip
asset_name: carbon-elements.sketchplugin.zip
asset_content_type: application/zip
29 changes: 29 additions & 0 deletions packages/carbon-react/__tests__/scss-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/**
* Copyright IBM Corp. 2018, 2018
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*
* @jest-environment node
*/

'use strict';

const { files } = require('@carbon/styles/files');
const { SassRenderer } = require('@carbon/test-utils/scss');

const { render } = SassRenderer.create(__dirname);

const relativePaths = files.map((file) => {
return file.relativePath;
});

describe('@carbon/react/scss', () => {
describe.each(relativePaths)('%s', (relativePath) => {
it('should be importable', async () => {
await expect(
render(`@use '../${relativePath}' as test;`)
).resolves.toBeDefined();
});
});
});
1 change: 1 addition & 0 deletions packages/carbon-react/index.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Code generated by @carbon/react. DO NOT EDIT.
//
// Copyright IBM Corp. 2018, 2018
//
Expand Down
1 change: 1 addition & 0 deletions packages/carbon-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"@babel/plugin-transform-react-constant-elements": "^7.16.7",
"@babel/preset-env": "^7.16.7",
"@babel/preset-react": "^7.16.7",
"@carbon/test-utils": "^10.21.0",
"@carbon/themes": "^10.53.0",
"@rollup/plugin-babel": "^5.3.0",
"@rollup/plugin-commonjs": "^21.0.0",
Expand Down
9 changes: 9 additions & 0 deletions packages/carbon-react/scss/components/_index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Code generated by @carbon/react. DO NOT EDIT.
//
// Copyright IBM Corp. 2018, 2018
//
// This source code is licensed under the Apache-2.0 license found in the
// LICENSE file in the root directory of this source tree.
//

@forward '@carbon/styles/scss/components';
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Code generated by @carbon/react. DO NOT EDIT.
//
// Copyright IBM Corp. 2018, 2018
//
// This source code is licensed under the Apache-2.0 license found in the
// LICENSE file in the root directory of this source tree.
//

@forward '@carbon/styles/scss/components/accordion/accordion';
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Code generated by @carbon/react. DO NOT EDIT.
//
// Copyright IBM Corp. 2018, 2018
//
// This source code is licensed under the Apache-2.0 license found in the
// LICENSE file in the root directory of this source tree.
//

@forward '@carbon/styles/scss/components/aspect-ratio/aspect-ratio';
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Code generated by @carbon/react. DO NOT EDIT.
//
// Copyright IBM Corp. 2018, 2018
//
// This source code is licensed under the Apache-2.0 license found in the
// LICENSE file in the root directory of this source tree.
//

@forward '@carbon/styles/scss/components/breadcrumb/breadcrumb';
9 changes: 9 additions & 0 deletions packages/carbon-react/scss/components/button/_button.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Code generated by @carbon/react. DO NOT EDIT.
//
// Copyright IBM Corp. 2018, 2018
//
// This source code is licensed under the Apache-2.0 license found in the
// LICENSE file in the root directory of this source tree.
//

@forward '@carbon/styles/scss/components/button/button';
9 changes: 9 additions & 0 deletions packages/carbon-react/scss/components/button/_tokens.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Code generated by @carbon/react. DO NOT EDIT.
//
// Copyright IBM Corp. 2018, 2018
//
// This source code is licensed under the Apache-2.0 license found in the
// LICENSE file in the root directory of this source tree.
//

@forward '@carbon/styles/scss/components/button/tokens';
9 changes: 9 additions & 0 deletions packages/carbon-react/scss/components/checkbox/_checkbox.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Code generated by @carbon/react. DO NOT EDIT.
//
// Copyright IBM Corp. 2018, 2018
//
// This source code is licensed under the Apache-2.0 license found in the
// LICENSE file in the root directory of this source tree.
//

@forward '@carbon/styles/scss/components/checkbox/checkbox';
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Code generated by @carbon/react. DO NOT EDIT.
//
// Copyright IBM Corp. 2018, 2018
//
// This source code is licensed under the Apache-2.0 license found in the
// LICENSE file in the root directory of this source tree.
//

@forward '@carbon/styles/scss/components/code-snippet/code-snippet';
Loading

0 comments on commit 0278575

Please sign in to comment.