Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update github action config --story=119540612 #3

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# This is a basic workflow to help you get started with Actions

name: frontend code eslint

on:
push:
branches: [ master, develop, release*, feature* ]
pull_request:
branches: [ master, develop, release*, feature* ]

jobs:
eslint:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'

- name: Install dependencies
run: |
cd frontend
npm install

- name: Run Eslint
run: |
cd frontend
npx eslint --ext .js,.vue src/
24 changes: 24 additions & 0 deletions .github/workflows/label-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: "Label PR based on title"

on:
- pull_request_target

jobs:
label-pr:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Label PR
run: |
PR_TITLE="${{ github.event.pull_request.title }}"
if [[ "$PR_TITLE" == "fix:"* ]]; then
gh pr edit ${{ github.event.pull_request.number }} --add-label bugfix
elif [[ "$PR_TITLE" == "feat:"* ]]; then
gh pr edit ${{ github.event.pull_request.number }} --add-label feature
else
echo "No label with this title: $PR_TITLE"
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 1 addition & 2 deletions .github/workflows/unittest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pip==24.0
pip install -r tests/requirements_test.txt
- name: Run Tests
run: |
Expand All @@ -38,7 +38,6 @@ jobs:
REDIS = {"host": "localhost", "port": 6379, "db": 0}
' > local_settings.py
echo "run interface unit test"
echo "run interface unit test"
sh scripts/run_interface_unit_test.sh
echo "run engine unit test"
sh scripts/run_engine_unit_test.sh
19 changes: 17 additions & 2 deletions commitlint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,30 @@ const Configuration = {
'perf',
'chore',
],
]
],
'content-rule': [2, 'always'],
},
plugins: [
{
rules: {
'content-rule': ({subject}) => {
const pattern = /#\d+$|--story=\d+$|--bug=\d+$/;
return [
pattern.test(subject.trim()),
`Your subject should contain issue id`,
];
}
}
}
],
/*
* Functions that return true if commitlint should ignore the given message.
*/
ignores: [
(commit) => commit === '',
(message) => message.includes('Merge'),
(message) => message.includes('merge')
(message) => message.includes('merge'),
(message) => message.includes('ignore')
],
/*
* Whether commitlint uses the default ignore rules.
Expand Down
3 changes: 3 additions & 0 deletions tests/engine.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
BKPAAS_APP_ID=bkflow
BKPAAS_APP_SECRET=bkflow_secret
BKPAAS_MAJOR_VERSION=3
BK_PAAS_HOST=bk_paas_host
BK_PAAS2_URL=bk_paas2_url
BKPAAS_LOGIN_URL=login_url
BKPAAS_REMOTE_STATIC_URL=static_url
BKPAAS_APIGW_OAUTH_API_URL=apigw_url
Expand Down
3 changes: 3 additions & 0 deletions tests/interface.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
BKPAAS_APP_ID=bkflow
BKPAAS_APP_SECRET=bkflow_secret
BKPAAS_MAJOR_VERSION=3
BK_PAAS_HOST=bk_paas_host
BK_PAAS2_URL=bk_paas2_url
BKPAAS_LOGIN_URL=login_url
BKPAAS_REMOTE_STATIC_URL=static_url
BKPAAS_APIGW_OAUTH_API_URL=apigw_url
Expand Down
Loading