Skip to content

Commit

Permalink
Update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
cregourd committed May 17, 2024
2 parents fbeb96e + 5df8b6a commit e5d96b6
Show file tree
Hide file tree
Showing 8 changed files with 276 additions and 6 deletions.
93 changes: 93 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: "Bug Report"
description: Create a new ticket for a bug.
title: "[BUG] - <title>"
labels: ["bug"]
body:
- type: textarea
id: description
attributes:
label: "Description"
description: Please enter an explicit description of your issue
placeholder: Short and explicit description of your incident...
validations:
required: true
- type: input
id: reprod-url
attributes:
label: "Reproduction URL"
description: Please enter your GitHub URL to provide a reproduction of the issue
placeholder: ex. https://github.com/USERNAME/REPO-NAME
validations:
required: true
- type: textarea
id: reprod
attributes:
label: "Reproduction steps"
description: Please enter an explicit description of your issue
value: |
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
render: bash
validations:
required: true
- type: dropdown
id: next-router
attributes:
label: "Next router"
description: What nex router are you seeing the problem on ?
multiple: true
options:
- App router
- Page router
validations:
required: true
- type: input
id: nextadmin-version
attributes:
label: "Next Admin version"
description: Please give the version of next admin
placeholder: ex. 3.1.1
validations:
required: true
- type: textarea
id: screenshot
attributes:
label: "Screenshots"
description: If applicable, add screenshots to help explain your problem.
value: |
![DESCRIPTION](LINK.png)
render: bash
validations:
required: false
- type: textarea
id: nextadmin-options
attributes:
label: "Next Admin options"
description: Please copy and paste any relevant Next Admin options. This will be automatically formatted into code, so no need for backticks.
render: ts
validations:
required: false
- type: textarea
id: logs
attributes:
label: "Logs"
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
render: bash
validations:
required: false
- type: dropdown
id: browsers
attributes:
label: "Browsers"
description: What browsers are you seeing the problem on ?
multiple: true
options:
- Firefox
- Chrome
- Safari
- Microsoft Edge
- Opera
validations:
required: false
39 changes: 39 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: "Feature Request"
description: Create a new ticket for a new feature request
title: "[FEATURE] - <title>"
labels: [
"enhancement"
]
body:
- type: textarea
id: summary
attributes:
label: "Summary"
description: Provide a brief explanation of the feature
placeholder: Describe in a few lines your feature request
validations:
required: true
- type: textarea
id: basic_example
attributes:
label: "Basic Example"
description: Indicate here some basic examples of your feature.
placeholder: A few specific words about your feature request.
validations:
required: true
- type: textarea
id: drawbacks
attributes:
label: "Drawbacks"
description: What are the drawbacks/impacts of your feature request ?
placeholder: Identify the drawbacks and impacts while being neutral on your feature request
validations:
required: false
- type: textarea
id: unresolved_question
attributes:
label: "Unresolved questions"
description: What questions still remain unresolved ?
placeholder: Identify any unresolved issues.
validations:
required: false
37 changes: 37 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
## Title

[Provide a succinct and descriptive title for the pull request, e.g., "Improve caching mechanism for API calls"]

## Type of Change

- [ ] New feature
- [ ] Bug fix
- [ ] Documentation update
- [ ] Refactoring
- [ ] Hotfix
- [ ] Security patch
- [ ] UI/UX improvement

## Issue

[Linked issues]

## Description

[Provide a detailed explanation of the changes you have made. Include the reasons behind these changes and any relevant context. Link any related issues.]

## Screenshots

[Add screenshot of the changes you have made]

## Testing

[Detail the testing you have performed to ensure that these changes function as intended. Include information about any added tests.]

## Impact

[Discuss the impact of your changes on the project. This might include effects on performance, new dependencies, or changes in behaviour.]

## Additional Information

[Any additional information that reviewers should be aware of.]
22 changes: 17 additions & 5 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: E2E tests
name: E2E, Lint & Unit tests
on:
push:
branches:
Expand All @@ -11,7 +11,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "18"
node-version: 18
cache: "yarn"
- name: Cache playwright dependencies
id: cache-playwright
Expand All @@ -23,14 +23,26 @@ jobs:
run: docker-compose up -d
- name: Install dependencies
run: yarn install
- name: Run linter
run: yarn lint
- name: Install playwright dependencies
if: steps.cache-playwright.outputs.cache-hit != 'true'
run: npx playwright install --with-deps
- name: Build packages
run: yarn build:example
- name: Fill database
run: yarn database
- name: Build packages
run: yarn build:example
- name: Start server
run: yarn start:example &
- name: Run tests
run: yarn turbo test:e2e
run: |
yarn test
yarn turbo test:e2e
cd apps/example && yarn prisma db seed && cd -
BASE_URL=http://localhost:3000/pagerouter/admin yarn test:e2e
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- v[0-9]+

concurrency: ${{ github.workflow }}-${{ github.ref }}

Expand All @@ -26,11 +27,12 @@ jobs:
- name: Link
run: yarn lint

- name: Create Release Pull Request or Publish
- name: Create Release Pull Request or Publish (${{ github.ref_name }})
uses: changesets/action@v1
with:
version: yarn changeset version
publish: yarn publish-package
title: ${{github.ref_name}} — Version Packages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
59 changes: 59 additions & 0 deletions .github/workflows/vercel-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Vercel deploy
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}

on:
workflow_call:
inputs:
environment:
required: true
type: string
extra_args:
required: false
type: string

jobs:
Deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18

- name: Install Dependencies
run: yarn install

- name: Install Vercel CLI
run: npm install --global vercel@latest

- name: Pull Vercel Environment Information (Docs)
run: vercel pull --yes --environment=${{ inputs.environment }} --token=${{ secrets.VERCEL_TOKEN }}
env:
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID_DOCS }}
- name: Build Project Artifacts (Docs)
run: vercel build ${{ inputs.extra_args }} --token=${{ secrets.VERCEL_TOKEN }}
env:
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID_DOCS }}
- name: Deploy Project Artifacts to Vercel (Docs)
run: vercel deploy ${{ inputs.extra_args }} --prebuilt --token=${{ secrets.VERCEL_TOKEN }}
env:
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID_DOCS }}

- name: Intermediate cleanup
run: rm -rf .vercel

- name: Pull Vercel Environment Information (Example)
run: vercel pull --yes --environment=${{ inputs.environment }} --token=${{ secrets.VERCEL_TOKEN }}
env:
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID_EXAMPLE }}
- name: Build Project Artifacts (Example)
run: vercel build ${{ inputs.extra_args }} --token=${{ secrets.VERCEL_TOKEN }}
env:
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID_EXAMPLE }}
- name: Deploy Project Artifacts to Vercel (Example)
run: vercel deploy ${{ inputs.extra_args }} --prebuilt --token=${{ secrets.VERCEL_TOKEN }}
env:
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID_EXAMPLE }}
12 changes: 12 additions & 0 deletions .github/workflows/vercel-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Vercel Preview Deployment

on:
push:
branches-ignore:
- main
jobs:
Deploy-Preview:
uses: ./.github/workflows/vercel-deploy.yml
secrets: inherit
with:
environment: preview
16 changes: 16 additions & 0 deletions .github/workflows/vercel-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Vercel Production Deployment

on:
pull_request:
types:
- closed
branches:
- "main"
jobs:
Deploy-Production:
if: github.event.pull_request.merged == true && (startsWith(github.event.pull_request.head.ref, 'changeset-release/') || (!contains(github.event.pull_request.changed_files, 'packages/next-admin/') && contains(github.event.pull_request.changed_files, 'apps/')))
uses: ./.github/workflows/vercel-deploy.yml
secrets: inherit
with:
environment: production
extra_args: --prod

0 comments on commit e5d96b6

Please sign in to comment.