Skip to content

Commit

Permalink
ci: test also on windows-latest (#167)
Browse files Browse the repository at this point in the history
* chore: transform test script into Python

* ci: test also on `windows-latest`
  • Loading branch information
felix-seifert authored Nov 22, 2023
1 parent 7b5cbb2 commit 0e91c43
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
os: ["ubuntu-latest", "macos-latest"]
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
Expand All @@ -26,4 +26,4 @@ jobs:
- name: Install dependencies
run: poetry install
- name: Run tests
run: poetry run ./run_tests.sh
run: poetry run python run_tests.py
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ poetry run python test_ghstack.py
```
That runs most of the tests; you can run all tests (including lints) like this:
```
poetry run ./run_tests.sh
poetry run python run_tests.py
```

### Publishing
Expand Down
33 changes: 33 additions & 0 deletions run_tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env python3

import subprocess
import os

# Set environment variable
os.environ['LIBCST_PARSER_TYPE'] = 'native'


def main():
try:
# ufmt check ghstack
subprocess.run(['ufmt', 'check', 'ghstack'], check=True)

# flake8 ghstack
subprocess.run(['flake8', 'ghstack'], check=True)

# mypy --install-types --non-interactive -m ghstack
subprocess.run(
['mypy', '--install-types', '--non-interactive', '-m', 'ghstack'],
check=True)

# pytest --verbose
subprocess.run(['pytest', '--verbose'], check=True)

print("OK")

except subprocess.CalledProcessError as e:
print(f"Error: {e}")


if __name__ == "__main__":
main()
8 changes: 0 additions & 8 deletions run_tests.sh

This file was deleted.

0 comments on commit 0e91c43

Please sign in to comment.