Skip to content

Commit

Permalink
Github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Raalsky committed Jul 26, 2024
1 parent 0708f0c commit 1a48ff2
Show file tree
Hide file tree
Showing 6 changed files with 152 additions and 2 deletions.
28 changes: 28 additions & 0 deletions .github/actions/install-package/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: Package
description: Install python and package
inputs:
python-version:
description: "Python version"
required: true
os:
description: "Operating system"
required: true

runs:
using: "composite"
steps:
- name: Install Python ${{ inputs.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python-version }}

- name: Install dependencies
run: |
pip install -r dev_requirements.txt
shell: bash

- name: List dependencies
run: |
pip list
shell: bash
47 changes: 47 additions & 0 deletions .github/actions/test-unit/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
name: Test Unit
description: Check unit tests
inputs:
python-version:
description: "Python version"
required: true
os:
description: "Operating system"
required: true
report_job:
description: "Job name to update by JUnit report"
required: true

runs:
using: "composite"
steps:
- name: Install package
uses: ./.github/actions/install-package
with:
python-version: ${{ inputs.python-version }}
os: ${{ inputs.os }}-latest

- name: Test
run: |
pytest -v ./tests/unit/ \
--timeout=120 --timeout_method=thread \
--color=yes \
--junitxml="./test-results/test-unit-new-${{ inputs.os }}-${{ inputs.python-version }}.xml"
shell: bash

- name: Upload test reports
uses: actions/upload-artifact@v3
if: always()
with:
name: test-artifacts
path: ./test-results

- name: Report
uses: mikepenz/[email protected]
if: always()
with:
report_paths: './test-results/test-unit-*.xml'
update_check: true
include_passed: true
annotate_notice: true
job_name: ${{ inputs.report_job }}
30 changes: 30 additions & 0 deletions .github/workflows/unit-in-pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Unittests

on:
workflow_dispatch:
push:
branches-ignore:
- main

jobs:
test:
timeout-minutes: 75
strategy:
fail-fast: false
matrix:
os: [ubuntu, windows, macos]
python-version: ["3.8"]
name: 'test (${{ matrix.os }} - py${{ matrix.python-version }})'
runs-on: ${{ matrix.os }}-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Run tests
uses: ./.github/actions/test-unit
with:
python-version: ${{ matrix.python-version }}
os: ${{ matrix.os }}
report_job: 'test (${{ matrix.os }} - py${{ matrix.python-version }})'
35 changes: 35 additions & 0 deletions .github/workflows/unit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: unit

on:
workflow_call:
workflow_dispatch:
schedule:
- cron: "0 4 * * *" # Run every day at arbitrary time (4:00 AM UTC)
push:
branches:
- main

jobs:
test:
timeout-minutes: 75
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
os: [ubuntu, windows, macos]

name: 'test (${{ matrix.os }} - py${{ matrix.python-version }})'
runs-on: ${{ matrix.os }}-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.client_payload.pull_request.head.ref }}

- name: Run tests
uses: ./.github/actions/test-unit
with:
python-version: ${{ matrix.python-version }}
os: ${{ matrix.os }}
report_job: 'test (${{ matrix.os }} - py${{ matrix.python-version }})'
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
## [UNRELEASED] neptune-client-scale 0.1.0
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added
- Added minimal Run classes ([#6](https://github.com/neptune-ai/neptune-client-scale/pull/6))
2 changes: 1 addition & 1 deletion dev_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
# dev
pre-commit
pytest
Faker
pytest-timeout

0 comments on commit 1a48ff2

Please sign in to comment.