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

Update quality.yml #3112

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
64 changes: 55 additions & 9 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,40 +23,86 @@ jobs:
include:
- python-version: 3.9
toxenv: py39,style,coverage-ci
- python-version: 3.10.9
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@b4ffde65f46336ab88eb53be808477a3936bae11
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Setup python
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c
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

- 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
- 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@49e6cd3b187936a73b8280d59ffd9da69df63ec9
uses: SonarSource/sonarcloud-github-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
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]