From 21d640f9af5e0b6f879af50c664eeb7579786ccd Mon Sep 17 00:00:00 2001 From: Matej Straka Date: Tue, 24 Sep 2024 15:56:44 +0200 Subject: [PATCH 1/5] ci: add test workflow --- .github/workflows/tests.yml | 35 +++++++++++++++++++++++++++++++++++ TODO.md | 2 +- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..787d605 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,35 @@ +name: tests + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.11' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt # Assuming you have a requirements.txt file + + - name: Run pytest + run: | + pytest + + - name: Run Python scripts + run: | + python3 tests/sb3_check.py diff --git a/TODO.md b/TODO.md index d43a72d..84fe71b 100644 --- a/TODO.md +++ b/TODO.md @@ -4,7 +4,7 @@ - [ ] Let user pass argument indicating what is the default opponent agent for Gymnasium environment. - [x] Extend action space by allowing user to be IDLE. - [ ] Add human control, so people can play against bots. -- [ ] Random agent new parameters +- [x] Random agent new parameters ### Improvements - [ ] Let user change game speed even when the game is paused; make 'Paused' text separate in the side panel. From 10cd75fa933afc9e38302c3b574f303a48f1a51c Mon Sep 17 00:00:00 2001 From: Matej Straka Date: Tue, 24 Sep 2024 16:00:39 +0200 Subject: [PATCH 2/5] ci: fix ci tests --- .github/workflows/tests.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 787d605..c900304 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -29,7 +29,3 @@ jobs: - name: Run pytest run: | pytest - - - name: Run Python scripts - run: | - python3 tests/sb3_check.py From ff883533c59cbf7c60d46ee49e4ff4e25409d2d0 Mon Sep 17 00:00:00 2001 From: Matej Straka Date: Tue, 24 Sep 2024 16:09:14 +0200 Subject: [PATCH 3/5] ci: add conventional commit checks --- .github/workflows/pre-commit-ci.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .github/workflows/pre-commit-ci.yml diff --git a/.github/workflows/pre-commit-ci.yml b/.github/workflows/pre-commit-ci.yml new file mode 100644 index 0000000..84b1083 --- /dev/null +++ b/.github/workflows/pre-commit-ci.yml @@ -0,0 +1,15 @@ +name: Check Commit Messages + +on: + pull_request: + branches: [master] + +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Check Commit Messages + uses: webiny/action-conventional-commits@v1.3.0 + with: + GITHUB_TOKEN: ${{ secrets.RELEASE_PLEASE_GENERALS }} From 9ba13e1832efd5b22067498a6ab95f7df236c6c4 Mon Sep 17 00:00:00 2001 From: Matej Straka Date: Tue, 24 Sep 2024 16:11:24 +0200 Subject: [PATCH 4/5] ci: better workflow names --- .github/workflows/pre-commit-ci.yml | 2 +- .github/workflows/tests.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pre-commit-ci.yml b/.github/workflows/pre-commit-ci.yml index 84b1083..9796219 100644 --- a/.github/workflows/pre-commit-ci.yml +++ b/.github/workflows/pre-commit-ci.yml @@ -1,4 +1,4 @@ -name: Check Commit Messages +name: Check commits for Conventional Commits practices on: pull_request: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c900304..7617d0c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,4 +1,4 @@ -name: tests +name: Run pytest on: push: From bebe9451beef18c8b011809489bd5ea5bfb44a14 Mon Sep 17 00:00:00 2001 From: Matej Straka Date: Tue, 24 Sep 2024 16:12:43 +0200 Subject: [PATCH 5/5] docs: fill TODO entries --- TODO.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TODO.md b/TODO.md index 84fe71b..53945b7 100644 --- a/TODO.md +++ b/TODO.md @@ -16,5 +16,5 @@ ### Documentation and CI - [ ] Create more examples of usage (Stable Baselines3 demo) -- [ ] Pre-commit hooks for conventional commit checks (enforcing conventional commits) -- [ ] Add CI for running tests (pre commit) +- [x] Pre-commit hooks for conventional commit checks (enforcing conventional commits) +- [x] Add CI for running tests (pre commit)