Skip to content

CI: Attach project binary to release page #7

CI: Attach project binary to release page

CI: Attach project binary to release page #7

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
pull_request:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
linter:
strategy:
fail-fast: false
matrix:
python-version: [3.11]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install project for developers
run: make install-dev
- name: Run linter
run: make lint
license-check:
strategy:
fail-fast: false
matrix:
python-version: [3.11]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Run license-check
run: make license-check
doc:
strategy:
fail-fast: false
matrix:
python-version: [3.11]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install project for developers
run: make install-dev
- name: Run Sphinx doc generation
run: make doc-sphinx
tests_linux:
needs: linter
strategy:
fail-fast: false
matrix:
python-version: [3.11]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install project for developers
run: make install-dev
- name: Run tests
id: unit-test
run: pytest -v --cov-config=.coveragerc --cov=nx_neptune -l --tb=short --maxfail=1 --cov-fail-under=80 tests/
- name: Package test reports
run: coverage xml && coverage html
if: always()
- name: Upload HTML coverage report
id: artifact-upload-step
uses: actions/upload-artifact@v4
if: always()
with:
name: coverage-report
path: htmlcov/
- name: Comment PR with artifact link
if: ${{ failure() && steps.unit-test.outcome == 'failure' && github.event_name == 'pull_request'}}
uses: actions/github-script@v7
with:
script: |
const artifactId = ${{ steps.artifact-upload-step.outputs.artifact-id }}
const prNumber = context.payload.pull_request.number;
const runId = context.runId;
const artifactUrl = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${runId}/artifacts/${artifactId}`;
github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: prNumber,
body: `📊 **Coverage Report**: Download the HTML report [here](${artifactUrl}).`
});
# Disable it until GA release
# tests_mac:
# needs: linter
# strategy:
# fail-fast: false
# matrix:
# python-version: [3.11]
# os: [macos-latest]
# runs-on: ${{ matrix.os }}
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-python@v5
# with:
# python-version: ${{ matrix.python-version }}
# - name: Install project for developers
# run: make install-dev
# - name: Run tests
# run: make test
# Disable it until GA release
# tests_win:
# needs: linter
# strategy:
# fail-fast: false
# matrix:
# python-version: [3.11]
# os: [windows-latest]
# runs-on: ${{ matrix.os }}
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-python@v5
# with:
# python-version: ${{ matrix.python-version }}
# - name: Install Pip
# run: pip install --user --upgrade pip
# - name: Install project
# run: pip install -e .[test]
# - name: run tests
# run: pytest -s -vvvv -l --tb=long tests