diff --git a/.github/workflows/pytest-rl.yml b/.github/workflows/pytest-rl.yml index 21d2e7d..2f0fbdb 100644 --- a/.github/workflows/pytest-rl.yml +++ b/.github/workflows/pytest-rl.yml @@ -4,9 +4,11 @@ on: push: paths: - "src/lpsim/env/**/*.py" + - "tests_env/**" pull_request: paths: - "src/lpsim/env/**/*.py" + - "tests_env/**" workflow_dispatch: workflow_call: @@ -29,6 +31,12 @@ jobs: run: | pip install -e ".[dev,rl]" + - name: Create pyrightconfig.json + run: | + echo '{ + "typeCheckingMode": "basic" + }' > pyrightconfig.json + - name: Run type check run: | pyright --version @@ -37,9 +45,5 @@ jobs: - name: Run tests with coverage run: | python -m setuptools_scm - python -m pytest --cov + python -m pytest -c ./pytest_env.ini --cov coverage xml - - - name: Upload coverage to Coveralls - if: github.ref == 'refs/heads/master' - uses: coverallsapp/github-action@v2 diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index e2bbbbc..28e12d0 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -8,6 +8,7 @@ on: - "**/*.py" - "!src/lpsim/env/**" - "!src/lpsim/network/**" + - "!tests_env/**" pull_request: paths: - "src/**" @@ -15,6 +16,7 @@ on: - "**/*.py" - "!src/lpsim/env/**" - "!src/lpsim/network/**" + - "!tests_env/**" workflow_dispatch: workflow_call: diff --git a/.github/workflows/rl-build-test.yml b/.github/workflows/rl-build-test.yml new file mode 100644 index 0000000..221436c --- /dev/null +++ b/.github/workflows/rl-build-test.yml @@ -0,0 +1,49 @@ +# test build CI, all the steps are the same as publish.yml, except will not publish +# to pypi or doing tests. +name: RL Test Build + +on: + workflow_dispatch: + push: + paths: + - "src/lpsim/env/**/*.py" + pull_request: + paths: + - "src/lpsim/env/**/*.py" + +jobs: + + test: + runs-on: ubuntu-latest + permissions: + id-token: write # IMPORTANT: this permission is mandatory for trusted publishing + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 # Shallow clones should be disabled for setuptools_scm + fetch-tags: true # Fetch all tags for setuptools_scm + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.10' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install ".[rl]" + + - name: Fetch tags and print + run: | + git tag + python -m setuptools_scm + + - name: Create distributions + run: | + python -m build + + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: package-rl + path: dist/*