Skip to content

Commit 110ef20

Browse files
The dataclass_array AuthorsConchylicultor
authored andcommitted
Code update
PiperOrigin-RevId: 465530281
1 parent e2d21b7 commit 110ef20

31 files changed

+4267
-2
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Unittests & Auto-publish
2+
3+
# Allow to trigger the workflow manually (e.g. when deps changes)
4+
on: [push, workflow_dispatch]
5+
6+
jobs:
7+
pytest-job:
8+
runs-on: ubuntu-latest
9+
timeout-minutes: 30
10+
11+
steps:
12+
- uses: styfle/[email protected]
13+
with:
14+
access_token: ${{ github.token }}
15+
16+
- uses: actions/checkout@v2
17+
18+
# Install deps
19+
- uses: actions/setup-python@v2
20+
with:
21+
python-version: 3.7
22+
- run: pip --version
23+
- run: pip install -e .[dev]
24+
- run: pip freeze
25+
26+
# Run tests (in parallel)
27+
- name: Run core tests
28+
run: pytest -vv -n auto
29+
30+
# Auto-publish when version is increased
31+
publish-job:
32+
# Only try to publish if:
33+
# * Repo is self (prevents running from forks)
34+
# * Branch is `main`
35+
if: |
36+
github.repository == 'google-research/dataclass_array'
37+
&& github.ref == 'refs/heads/main'
38+
needs: pytest-job # Only publish after tests are successful
39+
runs-on: ubuntu-latest
40+
permissions:
41+
contents: write
42+
timeout-minutes: 30
43+
44+
steps:
45+
# Publish the package (if local `__version__` > pip version)
46+
- uses: etils-actions/pypi-auto-publish@v1
47+
with:
48+
pypi-token: ${{ secrets.PYPI_API_TOKEN }}
49+
gh-token: ${{ secrets.GITHUB_TOKEN }}
50+
parse-changelog: true

.gitignore

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Compiled python modules.
2+
*.pyc
3+
4+
# Byte-compiled
5+
_pycache__/
6+
.cache/
7+
8+
# Poetry, setuptools, PyPI distribution artifacts.
9+
/*.egg-info
10+
.eggs/
11+
build/
12+
dist/
13+
poetry.lock
14+
15+
# Tests
16+
.pytest_cache/
17+
18+
# Type checking
19+
.pytype/
20+
21+
# Other
22+
*.DS_Store
23+
24+
# PyCharm
25+
.idea

0 commit comments

Comments
 (0)