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 aad10fe
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 44 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ jobs:
name: Tag and Release
runs-on: ubuntu-latest
steps:
- name: Test first
uses: test.yml

- name: Checkout repository (full-depth)
uses: actions/checkout@v4
with: { fetch-depth: 0 } # Required to determine version
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: "[auto] 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
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: env GITHUB_TOKEN=$GITHUB_TOKEN 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 @@ -20,9 +20,10 @@ envsubst < local-template/.gira.yaml > local/.gira.yaml


pushd local
git config --local user.email "" && git config --local user.name "Test Action"
git init 2> /dev/null
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 aad10fe

Please sign in to comment.