chore: fix yarn.lock conflicts
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
#.kodiak.toml
|
||||
version = 1
|
||||
|
||||
[merge]
|
||||
automerge_label = "automerge"
|
||||
require_automerge_label = true
|
||||
blocking_labels = ["on hold", "wip", "blocked"]
|
||||
method = "squash"
|
||||
delete_branch_on_merge = true
|
||||
optimistic_updates = false
|
||||
prioritize_ready_to_merge = true
|
||||
notify_on_conflict = true
|
||||
|
||||
[merge.message]
|
||||
title = "pull_request_title"
|
||||
body = "pull_request_body"
|
||||
include_coauthors= true
|
||||
include_pr_number = true
|
||||
body_type = "markdown"
|
||||
strip_html_comments = true
|
||||
@@ -0,0 +1,42 @@
|
||||
name: "Setup test env"
|
||||
description: "Setup test environment for actions"
|
||||
|
||||
inputs:
|
||||
node-version:
|
||||
description: "Node version"
|
||||
required: false
|
||||
default: "14"
|
||||
cache-extension:
|
||||
description: "Extension for fetching cached dependencies"
|
||||
required: true
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Cancel Previous Runs
|
||||
uses: styfle/cancel-workflow-action@0.9.1
|
||||
with:
|
||||
access_token: ${{ github.token }}
|
||||
|
||||
- name: Setup Node.js environment
|
||||
uses: actions/setup-node@v2.4.1
|
||||
with:
|
||||
node-version: ${{ inputs.node-version }}
|
||||
cache: "yarn"
|
||||
|
||||
- name: Bootstrap packages
|
||||
uses: ./.github/actions/cache-bootstrap
|
||||
with:
|
||||
extension: ${{ inputs.cache-extension }}
|
||||
|
||||
- name: Build Packages
|
||||
shell: "bash"
|
||||
run: yarn build
|
||||
|
||||
- name: Install dev cli
|
||||
shell: "bash"
|
||||
run: sudo npm i -g medusa-dev-cli
|
||||
|
||||
- name: Set path to medusa repo
|
||||
shell: "bash"
|
||||
run: medusa-dev --set-path-to-repo $(pwd)
|
||||
@@ -0,0 +1,33 @@
|
||||
name: "Test server"
|
||||
description: "Test the currently running medusa server to see if a user has been created and that the server is seeded"
|
||||
|
||||
inputs:
|
||||
email:
|
||||
description: "email of user to log in"
|
||||
required: false
|
||||
default: "test@test.com"
|
||||
password:
|
||||
description: "password of user to log in"
|
||||
required: false
|
||||
default: "password"
|
||||
pathToSeedData:
|
||||
description: "path to seed data"
|
||||
required: false
|
||||
default: "../cli-test/data/seed.json"
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Wait for live server response
|
||||
shell: "bash"
|
||||
run: ./integration-tests/scripts/cli/wait-for-server-live.sh
|
||||
- name: Log in with user
|
||||
shell: "bash"
|
||||
run: ./integration-tests/scripts/cli/login.sh ${{ inputs.email }} ${{ inputs.password }}
|
||||
- name: GetProducts
|
||||
shell: "bash"
|
||||
run: ./integration-tests/scripts/cli/get-products.sh ${{ inputs.pathToSeedData }}
|
||||
|
||||
- name: Kill server
|
||||
shell: "bash"
|
||||
run: kill -9 $(lsof -t -i :9000)
|
||||
@@ -1,9 +1,9 @@
|
||||
name: Medusa Pipeline
|
||||
on:
|
||||
on:
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- 'docs/**'
|
||||
- 'www/**'
|
||||
- "docs/**"
|
||||
- "www/**"
|
||||
|
||||
jobs:
|
||||
unit-tests:
|
||||
@@ -43,6 +43,15 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
services:
|
||||
redis:
|
||||
image: redis
|
||||
options: >-
|
||||
--health-cmd "redis-cli ping"
|
||||
--health-interval 10s
|
||||
--health-timeout 5s
|
||||
--health-retries 5
|
||||
ports:
|
||||
- 6379:6379
|
||||
postgres:
|
||||
image: postgres
|
||||
env:
|
||||
|
||||
@@ -0,0 +1,133 @@
|
||||
# Inspired from https://github.com/Shopify/quilt/blob/main/.github/workflows/snapit.yml
|
||||
name: Snapshot This
|
||||
|
||||
on:
|
||||
issue_comment:
|
||||
types:
|
||||
- created
|
||||
|
||||
concurrency: ${{ github.workflow }}-${{ github.ref }}
|
||||
|
||||
jobs:
|
||||
snapshot:
|
||||
name: Snapshot Release
|
||||
if: |
|
||||
github.event.issue.pull_request &&
|
||||
github.event.comment.body == '/snapshot-this'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Validate pull request
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
script: |
|
||||
try {
|
||||
// Add a rocket reaction to the comment
|
||||
await github.rest.reactions.createForIssueComment({
|
||||
...context.repo,
|
||||
comment_id: context.payload.comment.id,
|
||||
content: 'rocket',
|
||||
})
|
||||
|
||||
// Only allow comment creators who have "write" permissions to repo
|
||||
const actorPermission = (await github.rest.repos.getCollaboratorPermissionLevel({
|
||||
...context.repo,
|
||||
username: context.actor
|
||||
})).data.permission
|
||||
const isPermitted = ['write', 'admin'].includes(actorPermission)
|
||||
if (!isPermitted) {
|
||||
const errorMessage = 'Only users with write permission to the respository can run /snapshot-this'
|
||||
await github.rest.issues.createComment({
|
||||
...context.repo,
|
||||
issue_number: context.issue.number,
|
||||
body: errorMessage,
|
||||
})
|
||||
core.setFailed(errorMessage)
|
||||
return;
|
||||
}
|
||||
|
||||
const pullRequest = await github.rest.pulls.get({
|
||||
...context.repo,
|
||||
pull_number: context.issue.number,
|
||||
})
|
||||
// Pull request from fork
|
||||
if (context.payload.repository.full_name !== pullRequest.data.head.repo.full_name) {
|
||||
const errorMessage = '`/snapshot-this` is not supported on pull requests from forked repositories.'
|
||||
await github.rest.issues.createComment({
|
||||
...context.repo,
|
||||
issue_number: context.issue.number,
|
||||
body: errorMessage,
|
||||
})
|
||||
core.setFailed(errorMessage)
|
||||
}
|
||||
} catch (err) {
|
||||
core.setFailed(`Request failed with error ${err}`)
|
||||
}
|
||||
- name: Checkout pull request branch
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
ref: ${{ format('refs/pull/{0}/merge', github.event.issue.number) }}
|
||||
|
||||
# Because changeset entries are consumed and removed on the
|
||||
# 'changeset-release/main' branch, we need to reset the files
|
||||
# so the following 'changeset version --snapshot' command will
|
||||
# regenerate the package version bumps with the snapshot releases
|
||||
- name: Reset changeset entries on changeset-release/main branch
|
||||
run: |
|
||||
if [[ $(git branch --show-current) == 'changeset-release/main' ]]; then
|
||||
git checkout origin/main -- .changeset
|
||||
fi
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 16.x
|
||||
cache: "yarn"
|
||||
|
||||
- name: Bootstrap packages
|
||||
uses: ./.github/actions/cache-bootstrap
|
||||
with:
|
||||
extension: snapshot-this
|
||||
|
||||
- name: Create an .npmrc
|
||||
env:
|
||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
run: |
|
||||
cat << EOF > "$HOME/.npmrc"
|
||||
//registry.npmjs.org/:_authToken=$NPM_TOKEN
|
||||
EOF
|
||||
|
||||
- name: Create and publish snapshot release
|
||||
uses: actions/github-script@v6
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
script: |
|
||||
await exec.exec('yarn run changeset version --snapshot snapshot')
|
||||
const {stdout} = await exec.getExecOutput('yarn run release:snapshot')
|
||||
const newTags = Array
|
||||
.from(stdout.matchAll(/New tag:\s+([^\s\n]+)/g))
|
||||
.map(([_, tag]) => tag)
|
||||
if (newTags.length) {
|
||||
const multiple = newTags.length > 1
|
||||
const body = (
|
||||
`#### :rocket: A snapshot release has been made for this PR\n\n` +
|
||||
`Test the snapshot${multiple ? 's' : ''} by updating your \`package.json\` ` +
|
||||
`with the newly published version${multiple ? 's' : ''}:\n` +
|
||||
newTags.map(tag => (
|
||||
'```sh\n' +
|
||||
`yarn add ${tag}\n` +
|
||||
'```'
|
||||
)).join('\n') +
|
||||
`\n\n> Latest commit: ${context.sha}`
|
||||
|
||||
)
|
||||
await github.rest.issues.createComment({
|
||||
...context.repo,
|
||||
issue_number: context.issue.number,
|
||||
body,
|
||||
})
|
||||
await github.rest.reactions.createForIssueComment({
|
||||
...context.repo,
|
||||
comment_id: context.payload.comment.id,
|
||||
content: 'hooray',
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
name: CLI Pipeline
|
||||
on: [pull_request]
|
||||
|
||||
jobs:
|
||||
test-cli-with-database:
|
||||
env:
|
||||
REDIS_URL: redis://localhost:6379
|
||||
DATABASE_URL: "postgres://postgres:postgres@localhost/cli-test"
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
db: [sqlite, postgres]
|
||||
|
||||
services:
|
||||
redis:
|
||||
image: redis
|
||||
# Set health checks to wait until redis has started
|
||||
options: >-
|
||||
--health-cmd "redis-cli ping"
|
||||
--health-interval 10s
|
||||
--health-timeout 5s
|
||||
--health-retries 5
|
||||
ports:
|
||||
- 6379:6379
|
||||
|
||||
postgres:
|
||||
image: postgres
|
||||
env:
|
||||
POSTGRES_PASSWORD: postgres
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_DB: cli-test
|
||||
options: >-
|
||||
--health-cmd pg_isready
|
||||
--health-interval 10s
|
||||
--health-timeout 5s
|
||||
--health-retries 5
|
||||
ports:
|
||||
- 5432:5432
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2.3.5
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup development server
|
||||
uses: ./.github/actions/setup-server
|
||||
with:
|
||||
cache-extension: "cli-test"
|
||||
|
||||
- name: Install Medusa cli
|
||||
run: yarn global add @medusajs/medusa-cli
|
||||
|
||||
- name: Create Medusa project
|
||||
run: |
|
||||
medusa new cli-test
|
||||
working-directory: ..
|
||||
|
||||
- name: Install postgres config
|
||||
if: matrix.db == 'postgres'
|
||||
run: |
|
||||
curl \
|
||||
https://raw.githubusercontent.com/medusajs/medusa-starter-default/feat/postgres-config/medusa-config.js \
|
||||
--output medusa-config.js
|
||||
working-directory: ../cli-test
|
||||
|
||||
- name: run medusa dev
|
||||
run: medusa-dev --force-install
|
||||
working-directory: ../cli-test
|
||||
|
||||
- name: Run migrations
|
||||
run: medusa migrations run
|
||||
working-directory: ../cli-test
|
||||
|
||||
- name: Seed db
|
||||
run: yarn seed
|
||||
working-directory: ../cli-test
|
||||
|
||||
- name: Create admin user
|
||||
run: medusa user -e test@test.com -p password -i admin_123
|
||||
working-directory: ../cli-test
|
||||
|
||||
########################## Test medusa develop ###############################
|
||||
|
||||
- name: Run development server
|
||||
run: medusa develop > /dev/null 2>&1 &
|
||||
working-directory: ../cli-test
|
||||
|
||||
- name: Testing development server
|
||||
uses: ./.github/actions/test-server
|
||||
|
||||
########################### Test medusa start ################################
|
||||
|
||||
- name: Starting medusa
|
||||
run: medusa start > /dev/null 2>&1 &
|
||||
working-directory: ../cli-test
|
||||
|
||||
- name: Testing server
|
||||
uses: ./.github/actions/test-server
|
||||
Reference in New Issue
Block a user