Skip to content

Commit

Permalink
chore: improve workflows for code checking and PR (#110)
Browse files Browse the repository at this point in the history
  • Loading branch information
xushiyan authored Aug 11, 2024
1 parent f75f12d commit b3ffa32
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 26 deletions.
43 changes: 17 additions & 26 deletions .github/workflows/compliance.yml → .github/workflows/code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,53 +15,44 @@
# specific language governing permissions and limitations
# under the License.

name: Compliance
name: Code

on:
pull_request_target:
types: [ opened, edited, reopened, synchronize ]
push:
branches:
- main
- release/**
pull_request:
branches:
- main

permissions:
contents: read
pull-requests: write

jobs:
check-pr:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
node-version: '20.x'
- name: Linting
run: |
npm i -g conventional-changelog-conventionalcommits
npm i -g commitlint@latest
echo ${{ github.event.pull_request.title }} | npx commitlint
- name: Labeling
uses: actions/labeler@v5
check-changes:
check-code:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Check license header
uses: apache/skywalking-eyes/[email protected]

- name: Check rust code style
run: cd python && make check-rust
- name: Set up Python ${{ matrix.python-version }}

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
python-version: '3.8'
cache: pip
cache-dependency-path: pyproject.toml

- name: Install python linter dependencies
working-directory: ./python
run: |
make setup-env
make setup-venv
source venv/bin/activate
pip install ruff mypy
- name: Run python linter
pip install ruff==0.5.2 mypy==1.10.1
- name: Check python code style
working-directory: ./python
run: |
source venv/bin/activate
Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

name: PR

on:
pull_request:
types: [ opened, edited, reopened, synchronize ]
branches:
- main

permissions:
contents: read
pull-requests: write

jobs:
check-pr:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20

- name: Linting commit
run: |
npm i -g conventional-changelog-conventionalcommits
npm i -g commitlint@latest
echo ${{ github.event.pull_request.title }} | npx commitlint
- name: Labeling
uses: actions/labeler@v5

0 comments on commit b3ffa32

Please sign in to comment.