Skip to content

Commit

Permalink
fix: add issue template and workflow fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sarthakjdev authored Sep 14, 2023
1 parent 95f2da7 commit 0e5d51d
Show file tree
Hide file tree
Showing 9 changed files with 523 additions and 48 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
10 changes: 10 additions & 0 deletions .github/workflows/ISSUE_TEMPLATE/custom.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: Custom issue template
about: Describe this issue template's purpose here.
title: ''
labels: ''
assignees: ''

---


20 changes: 20 additions & 0 deletions .github/workflows/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
16 changes: 0 additions & 16 deletions .github/workflows/build.yml

This file was deleted.

20 changes: 0 additions & 20 deletions .github/workflows/lint.yml

This file was deleted.

105 changes: 105 additions & 0 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: Build

on:
push:
branches:
- 'master'

jobs:
lint:
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: User Node.js LTS
uses: actions/setup-node@v2

- name: Install Dependencies
run: yarn install --frozen-lockfile

- name: Lint
run: yarn run lint

- name: Linter Failed
if: ${{ failure() }}
uses: actions/github-script@v5
with:
script: |
const { pullRequestData: data } = await github.rest.repos.listPullRequestsAssociatedWithCommit({
owner: context.repo.owner,
repo: context.repo.repo,
commit_sha: context.payload.after
})
if(pullRequestData[0]){
await github.rest.issues.createComment({
issue_number: pullRequestData[0].number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `### 🚨 Linter failed`
})
} else {
throw new Error('Pull request data not found')
}
build:
runs-on: ubuntu-latest
needs: [lint]
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install Dependencies
run: yarn install --frozen-lockfile

- name: Build the packages
run: yarn build

- name: Build Success
if: ${{ success() }}
uses: actions/github-script@v6
with:
script: |
const fs = require("fs")
const path = require("path")
const { data: pullRequestData } = await github.rest.repos.listPullRequestsAssociatedWithCommit({
owner: context.repo.owner,
repo: context.repo.repo,
commit_sha: context.payload.after
})
if(pullRequestData[0]){
await github.rest.issues.createComment({
issue_number: pullRequestData[0].number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `#### 🟢 Build success`
})
} else {
throw new Error('Pull request data not found')
}
- name: Build Failed
if: ${{ failure() }}
uses: actions/github-script@v6
with:
script: |
const { data: pullRequestData } = await github.rest.repos.listPullRequestsAssociatedWithCommit({
owner: context.repo.owner,
repo: context.repo.repo,
commit_sha: context.payload.after
})
if(pullRequestData[0]){
await github.rest.issues.createComment({
issue_number: pullRequestData[0].number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `#### ❌ Build failed:
`
})
} else {
throw new Error('Pull request data not found')
}
105 changes: 105 additions & 0 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: Build

on:
push:
branches-ignore:
- 'master'

jobs:
lint:
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: User Node.js LTS
uses: actions/setup-node@v2

- name: Install Dependencies
run: yarn install --frozen-lockfile

- name: Lint
run: yarn run lint

- name: Linter Failed
if: ${{ failure() }}
uses: actions/github-script@v5
with:
script: |
const { pullRequestData: data } = await github.rest.repos.listPullRequestsAssociatedWithCommit({
owner: context.repo.owner,
repo: context.repo.repo,
commit_sha: context.payload.after
})
if(pullRequestData[0]){
await github.rest.issues.createComment({
issue_number: pullRequestData[0].number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `### 🚨 Linter failed`
})
} else {
throw new Error('Pull request data not found')
}
build:
runs-on: ubuntu-latest
needs: [lint]
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install Dependencies
run: yarn install --frozen-lockfile

- name: Build the packages
run: yarn build

- name: Build Success
if: ${{ success() }}
uses: actions/github-script@v6
with:
script: |
const fs = require("fs")
const path = require("path")
const { data: pullRequestData } = await github.rest.repos.listPullRequestsAssociatedWithCommit({
owner: context.repo.owner,
repo: context.repo.repo,
commit_sha: context.payload.after
})
if(pullRequestData[0]){
await github.rest.issues.createComment({
issue_number: pullRequestData[0].number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `#### 🟢 Build success`
})
} else {
throw new Error('Pull request data not found')
}
- name: Build Failed
if: ${{ failure() }}
uses: actions/github-script@v6
with:
script: |
const { data: pullRequestData } = await github.rest.repos.listPullRequestsAssociatedWithCommit({
owner: context.repo.owner,
repo: context.repo.repo,
commit_sha: context.payload.after
})
if(pullRequestData[0]){
await github.rest.issues.createComment({
issue_number: pullRequestData[0].number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `#### ❌ Build failed:
`
})
} else {
throw new Error('Pull request data not found')
}
6 changes: 4 additions & 2 deletions packages/wapi.js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,7 @@
"prettier": "^3.0.3",
"typescript": "^5.2.2"
},
"@wapijs/component-generator": "workspace:^"
}
"dependencies": {
"dayjs": "^1.11.9"
}
}
Loading

0 comments on commit 0e5d51d

Please sign in to comment.