Skip to content

Commit

Permalink
add github action for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
lilioid committed Feb 12, 2024
1 parent fd5b746 commit 2587968
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 3 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: test
on:
push:
branches: [ "*" ]

env:
artifact_name: test_project

jobs:
create-test-project:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: install dependencies
run: |
sudo apt install cookiecutter pre-commit npm
pip install pipenv
npm install -g pnpm
- name: create project with cookiecutter
run: |
git config --global init.defaultBranch main
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions"
cookiecutter --no-input --output-dir /tmp ./ project_slug=github_test_project
- id: upload-artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.artifact_name }}
path: |
/tmp/github_test_project
!/tmp/github_test_project/**/node_modules
retention-days: 1

run-test-project:
runs-on: ubuntu-latest
needs: [ create-test-project ]
steps:
- uses: actions/download-artifact@v4
with:
name: ${{ env.artifact_name }}
2 changes: 1 addition & 1 deletion hooks/post_gen_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ def git_commit(message: str):
# lock & install dependencies
subprocess.check_call("pipenv lock".split(" "))
subprocess.check_call("pipenv sync".split(" "))
subprocess.check_call("pnpm install".split(" "), cwd="./src/{{ cookiecutter.project_slug }}_gui")
subprocess.check_call("pnpm install --no-frozen-lockfile".split(" "), cwd="./src/{{ cookiecutter.project_slug }}_gui")
git_commit("lock dependencies")
4 changes: 2 additions & 2 deletions {{ cookiecutter.project_slug }}/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ repos:
- id: check-added-large-files

- repo: https://github.com/psf/black.git
rev: "23.11.0"
rev: "24.1.1"
hooks:
- id: black

- repo: https://github.com/PyCQA/isort.git
rev: "5.12.0"
rev: "5.13.2"
hooks:
- id: isort

0 comments on commit 2587968

Please sign in to comment.