Skip to content

Update quality.yml #1322

Update quality.yml

Update quality.yml #1322

Workflow file for this run

name: Code Quality
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
workflow_dispatch:
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
strategy:
fail-fast: false
matrix:
include:
- python-version: 3.9
toxenv: py39,style,coverage-ci
os: ubuntu-latest
- python-version: 3.10
toxenv: py310,style,coverage-ci
os: ubuntu-latest
- python-version: 3.11
toxenv: py311,style,coverage-ci
os: macos-latest
- python-version: 3.12
toxenv: py312,style,coverage-ci
os: windows-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Cache Python Dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: python-${{ matrix.python-version }}-pip-${{ runner.os }}-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
python-${{ matrix.python-version }}-pip-${{ runner.os }}-
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Cache Node.js Dependencies
uses: actions/cache@v3
with:
path: ~/.npm
key: node-${{ matrix.os }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
node-${{ matrix.os }}-
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
- name: Install Dependencies
run: |
pip install --upgrade virtualenv
pip install tox
npm --prefix plugins/magma install
npm --prefix plugins/magma run build
- name: Run Tests
env:
TOXENV: ${{ matrix.toxenv }}
run: tox
- name: Override Coverage Source Path for Sonar
run: sed -i "s/<source>\/home\/runner\/work\/caldera\/caldera/<source>\/github\/workspace/g" /home/runner/work/caldera/caldera/coverage.xml
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
notify:
runs-on: ubuntu-latest
needs: build
if: failure()
steps:
- name: Send Failure Notification
uses: dawidd6/action-send-mail@v3
with:
server_address: smtp.gmail.com
server_port: 587
username: ${{ secrets.SMTP_USERNAME }}
password: ${{ secrets.SMTP_PASSWORD }}
subject: "GitHub Actions Failed"
body: |
Job Name: Code Quality
Repository: ${{ github.repository }}
Branch: ${{ github.ref }}
Commit: ${{ github.sha }}
to: [email protected]