Skip to content

Commit

Permalink
Merge pull request #57 from foikila/add-actions
Browse files Browse the repository at this point in the history
Add Github actions
  • Loading branch information
mosbth authored Sep 10, 2024
2 parents 1e97541 + 896321f commit e22b03f
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 2 deletions.
14 changes: 14 additions & 0 deletions .github/actions/install/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Install dependencies
description: Install dependencies for the project
runs:
using: composite
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
cache: 'pip'
cache-dependency-path: .requirements.txt
- name: Install dependencies
shell: bash
run: make install-tools
49 changes: 49 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Continuous integration

on:
# Trigger the workflow on push or pull request,
push:
# Trigger the workflow via a manual run
workflow_dispatch:

# Ensures that only one deploy task per branch/environment will run at a time.
concurrency:
group: environment-${{ github.ref }}
cancel-in-progress: true

jobs:
install:
name: Install dependencies
runs-on: ubuntu-24.04
timeout-minutes: 1
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Install dependencies
uses: ./.github/actions/install

unit-test:
name: Run unit test
runs-on: ubuntu-24.04
timeout-minutes: 1
needs: [install]
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Install dependencies
uses: ./.github/actions/install
- name: Run tests
run: make test

lint:
name: Lint with Pylint
runs-on: ubuntu-24.04
timeout-minutes: 1
needs: [install]
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Install dependencies
uses: ./.github/actions/install
- name: Lint with Pylint
run: make pylint
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -153,15 +153,15 @@ coverage:
.PHONY: install-tools
install-tools:
@$(call HELPTEXT,$@)
python3 -m pip install --requirement .requirements.txt
python3 -m pip install --requirement .requirements.txt



# target: upgrade-tools - Upgrade needed devtools.
.PHONY: upgrade-tools
upgrade-tools:
@$(call HELPTEXT,$@)
python3 -m pip install --upgrade --requirement .requirements.txt
python3 -m pip install --upgrade --requirement .requirements.txt


# target: check - Check versions of installed devtools.
Expand Down

0 comments on commit e22b03f

Please sign in to comment.