Skip to content

Commit

Permalink
Lint and unit tests workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
themylogin committed Jan 23, 2025
1 parent b4cae3b commit a726a75
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 40 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: flake8

on:
pull_request:
types:
- 'synchronize'
- 'opened'

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v3
with:
python-version: 3.11
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
- name: Analyze the code with flake8
run: flake8 .
36 changes: 36 additions & 0 deletions .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# 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: [ "master" ]
pull_request:
branches: [ "master" ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
container:
image: ghcr.io/truenas/middleware:master

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3

- name: Deploy
run: |
./src/freenas/usr/bin/install-dev-tools
- name: Test
run:
pytest-3 -v --disable-pytest-warnings tests/
10 changes: 0 additions & 10 deletions .travis.yml

This file was deleted.

30 changes: 0 additions & 30 deletions .travis/flake8.sh

This file was deleted.

3 changes: 3 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[flake8]
exclude = tests/*
max-line-length = 120

0 comments on commit a726a75

Please sign in to comment.