Skip to content

Commit

Permalink
Merge pull request #6 from H-IAAC/dev
Browse files Browse the repository at this point in the history
Memory Storage and Gym codelet
  • Loading branch information
EltonCN authored Dec 9, 2024
2 parents c74f8b4 + 459faa5 commit 894cb74
Show file tree
Hide file tree
Showing 35 changed files with 4,940 additions and 33 deletions.
66 changes: 38 additions & 28 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,46 +6,56 @@ on:
branches: [ dev, main ]

jobs:
test:

runs-on: ${{ matrix.os }}
test-linux:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ["3.10", "3.11", "3.12"]

services:
# Label used to access the service container
redis:
# Docker Hub image
image: redis
# Set health checks to wait until redis has started
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps port 6379 on service container to the host
- 6379:6379

steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install pytest
python3 -m pip install pytest-cov
python3 -m pip install -e .[tests]
- uses: actions/checkout@v2

- uses: ./.github/workflows/test_inner
with:
os: ubuntu-latest
python-version: ${{ matrix.python-version }}

- name: Tests
run: |
pytest --cov=cst_python --cov-report json
shell: bash

- if: ${{matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'}}
name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: coverage_report
path: coverage.json
test-windows:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v2

- uses: ./.github/workflows/test_inner
with:
os: windows-latest
python-version: ${{ matrix.python-version }}

coverage-check:
runs-on: ubuntu-latest
needs:
- test
- test-linux

steps:
- uses: actions/checkout@v2
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/test_inner/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Test inner

inputs:
os:
required: true
type: string
python-version:
required: true
type: string

runs:
using: composite
steps:
- uses: actions/checkout@v2

- name: Set up Python ${{inputs.python-version}}
uses: actions/setup-python@v2
with:
python-version: ${{inputs.python-version}}

- name: Install dependencies
shell: bash
run: |
python3 -m pip install --upgrade pip
python3 -m pip install pytest
python3 -m pip install pytest-cov
python3 -m pip install -e .[tests,gym,memory_storage]
- name: Tests
shell: bash
run: |
pytest --cov=cst_python --cov-report json
- if: ${{inputs.os == 'ubuntu-latest' && inputs.python-version == '3.12'}}
name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: coverage_report
path: coverage.json

Loading

0 comments on commit 894cb74

Please sign in to comment.