ci: add github action that analyzes all python functions #1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .github/workflows/analyze_functions.yml | |
name: Analyze Python Functions | |
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
analyze: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source branch | |
uses: actions/checkout@v2 | |
with: | |
ref: ${{ github.head_ref }} | |
- name: Install Python and dependencies | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.x' | |
- run: pip install pyyaml | |
- name: Analyze source branch | |
run: | | |
python tools/analyze_functions.py analyze source_functions_info.yml cloudinit tests | |
- name: Upload source analysis result | |
uses: actions/upload-artifact@v2 | |
with: | |
name: source-functions-info | |
path: source_functions_info.yml | |
- name: Checkout target branch | |
uses: actions/checkout@v2 | |
with: | |
ref: ${{ github.base_ref }} | |
- name: Download source analysis result | |
uses: actions/download-artifact@v2 | |
with: | |
name: source-functions-info | |
- name: Analyze target branch | |
run: | | |
python tools/analyze_functions.py analyze target_functions_info.yml cloudinit tests | |
- name: Compare analysis results | |
run: python tools/analyze_functions.py compare source_functions_info.yml target_functions_info.yml |