Skip to content

Commit

Permalink
ci: add on pull/push CI workflows
Browse files Browse the repository at this point in the history
This commit adds the corresponding workflows for on pull and push actions, enabling
linting and unit testing.
  • Loading branch information
DnPlas committed Feb 7, 2024
1 parent a0d974c commit f59612b
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/integrate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# reusable workflow triggered by other actions
name: CI

jobs:

lint:
name: Lint Check
runs-on: ubuntu-20.04

steps:
- name: Check out code
uses: actions/checkout@v3

- name: Install dependencies
run: sudo apt-get install python3-pip tox

- name: Lint code
run: tox -e lint

unit:
name: Unit Test
runs-on: ubuntu-20.04

steps:
- name: Check out code
uses: actions/checkout@v3

- name: Install dependencies
run: sudo apt-get install python3-pip tox

- name: Run unit tests
run: tox -e unit
14 changes: 14 additions & 0 deletions .github/workflows/on_pull_request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: On Pull Request

# On pull_request, we:
# * always publish to charmhub at latest/edge/branchname
# * always run tests

on:
pull_request:

jobs:

tests:
name: Run Tests
uses: ./.github/workflows/integrate.yaml
20 changes: 20 additions & 0 deletions .github/workflows/on_push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: On Push

# On push to a "special" branch, we:
# * always publish to charmhub at latest/edge/branchname
# * always run tests
# where a "special" branch is one of main/master or track/**, as
# by convention these branches are the source for a corresponding
# charmhub edge channel.

on:
push:
branches:
- master
- main
- track/**

jobs:
tests:
name: Run Tests
uses: ./.github/workflows/integrate.yaml

0 comments on commit f59612b

Please sign in to comment.