-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1098 from chromaui/cody/cap-2324-create-a-new-act…
…ion-to-properly-test-the-action Add new check to test the CLI action in merge queue
- Loading branch information
Showing
4 changed files
with
70 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
name: Lint and Test | ||
on: push | ||
on: [push, merge_group] | ||
|
||
permissions: | ||
contents: read | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Smoke test via action next | ||
on: merge_group | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
lint-and-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: lts/* | ||
- run: corepack enable | ||
- run: yarn | ||
- name: Push to action-next | ||
run: yarn run release-next | ||
env: | ||
GH_TOKEN: ${{ secrets.GH_TOKEN }} | ||
- name: Run build against action-next | ||
uses: chromaui/action-next@latest | ||
with: | ||
buildScriptName: build-test-storybook | ||
exitZeroOnChanges: true | ||
forceRebuild: true | ||
env: | ||
LOG_LEVEL: debug | ||
DEBUG: chromatic-cli | ||
CHROMATIC_PROJECT_TOKEN: ${{ secrets.SMOKE_TESTS_CHROMATIC_PROJECT_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/usr/bin/env node | ||
|
||
import { $ } from 'execa'; | ||
|
||
import { main as publishAction } from './publishAction.mjs'; | ||
|
||
async function main() { | ||
const { stdout: status } = await $`git status --porcelain`; | ||
if (status) { | ||
console.error(`❗️ Working directory is not clean:\n${status}`); | ||
return; | ||
} | ||
|
||
await build(); | ||
await publishAction('next'); | ||
} | ||
|
||
async function build() { | ||
const { stdout: nextVersion } = await $`auto shipit --dry-run --quiet`; | ||
|
||
console.info(`📌 Temporarily bumping version to '${nextVersion}' for build step`); | ||
await $`npm --no-git-tag-version version ${nextVersion}`; | ||
|
||
console.info('📦 Building with new version'); | ||
await $({ | ||
stdio: 'inherit', | ||
env: { | ||
...process.env, | ||
SENTRY_RELEASE: nextVersion, | ||
}, | ||
})`yarn build`; | ||
|
||
console.info('✅ Build with new version completed, ready for push to action-next!'); | ||
} | ||
|
||
main(); |