-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add on pull/push CI workflows (#4)
* ci: add on pull/push CI workflows This commit adds the corresponding workflows for on pull and push actions, enabling linting and unit testing.
- Loading branch information
Showing
3 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# reusable workflow triggered by other actions | ||
name: CI | ||
|
||
on: | ||
workflow_call: | ||
|
||
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 | ||
python3 -m pip install 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
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: | ||
- main | ||
- track/** | ||
|
||
jobs: | ||
tests: | ||
name: Run Tests | ||
uses: ./.github/workflows/integrate.yaml |