Skip to content

Commit

Permalink
chore(ci): add tests to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomas Peterka committed Feb 13, 2024
1 parent dd706c3 commit 8d13098
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 44 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ jobs:
uses: actions/checkout@v4
with: { fetch-depth: 0 } # Required to determine version

- name: But Test First
env:
GH_TOKEN: ${{ github.token }}
run: gh workflow run Test

- name: Get next release version
uses: dronetag/actions/semantic-release@main
id: semantic
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: "Test"

on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_call:

jobs:
build:
name: Run automated tests
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install tools
run: python3 -m pip install --upgrade pip setuptools wheel

- name: Install DEV dependencies
run: pip install -e .[dev]

- name: Run pro-commit checks
run: |
pip install pre-commit
pre-commit run --all-files
- name: Run tests
run: bash run_tests.sh
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@
*.egg-info
*.pyc
*.pyo

2 changes: 0 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ repos:
stages: [pre-commit]
- id: check-added-large-files
stages: [pre-commit]
- id: detect-aws-credentials
stages: [pre-commit]
- id: detect-private-key
stages: [pre-commit]
- id: check-json
Expand Down
78 changes: 39 additions & 39 deletions tests/local-template/poetry/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions tests/run.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set -e
set -ex

export GIRA_TEST_ROOT=$PWD

Expand All @@ -21,8 +21,9 @@ envsubst < local-template/.gira.yaml > local/.gira.yaml

pushd local
git init 2> /dev/null
git config user.name "Test Action" && git config user.email ""
git add .
git commit -m "Initial commit" 2> /dev/null
git commit -m "Initial commit"

# run on no changes in dependencies
echo "-- Test no changes" > README.md
Expand Down

0 comments on commit 8d13098

Please sign in to comment.