Skip to content

Commit

Permalink
ci: create RL ci
Browse files Browse the repository at this point in the history
  • Loading branch information
zyr17 committed Jul 11, 2024
1 parent d47eeb2 commit 6331dc2
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 5 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/pytest-rl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -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
Expand All @@ -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
2 changes: 2 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ on:
- "**/*.py"
- "!src/lpsim/env/**"
- "!src/lpsim/network/**"
- "!tests_env/**"
pull_request:
paths:
- "src/**"
- "tests/**"
- "**/*.py"
- "!src/lpsim/env/**"
- "!src/lpsim/network/**"
- "!tests_env/**"
workflow_dispatch:
workflow_call:

Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/rl-build-test.yml
Original file line number Diff line number Diff line change
@@ -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/*

0 comments on commit 6331dc2

Please sign in to comment.