Add focus punch to _FROM_DATA #1373
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run tests | |
on: | |
push: | |
branches: | |
- "master" | |
pull_request: | |
branches: | |
- "master" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
strategy: | |
matrix: | |
version: ['3.9', '3.10', '3.11', '3.12', '3.13'] | |
steps: | |
- name: Checkout repository code | |
uses: actions/checkout@v4 | |
# Setup Python (faster than using Python container) | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.version }} | |
- name: Install dev dependencies | |
run: pip install -r requirements-dev.txt | |
- name: Install dependencies | |
run: pip install -r requirements.txt | |
- name: Run tests | |
run: PYTHONPATH=src pytest -x --cov=src/poke_env unit_tests/ | |
- name: Convert coverage to XML | |
run: coverage xml | |
- name: Upload coverage report to Codecov | |
uses: codecov/codecov-action@v5 | |
with: | |
file: coverage.xml | |
- name: Build package | |
run: | | |
pip install build | |
python -m build | |
- name: Install built package | |
run: pip install --force-reinstall dist/*.whl | |
- name: Remove source | |
run: rm -rf ./src | |
- name: Run package-based tests | |
run: pytest -x unit_tests/ | |
- name: Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
- name: Checkout PS | |
uses: actions/checkout@v4 | |
with: | |
repository: smogon/pokemon-showdown | |
path: pokemon-showdown | |
submodules: recursive | |
- name: Get last showdown commit hash | |
id: showdown-hash | |
run: | | |
cd pokemon-showdown/ | |
export hash=`git log -1 --pretty=format:%H` | |
echo "hash=$hash" >> $GITHUB_OUTPUT | |
- name: Restore server cache | |
uses: actions/cache@v4 | |
with: | |
path: pokemon-showdown/node_modules | |
key: showdown-python${{ matrix.version }}-${{ steps.showdown-hash.outputs.hash }} | |
restore-keys: showdown-python${{ matrix.version }}- | |
- name: Install PS dependencies & setup config | |
run: | | |
cd pokemon-showdown | |
npm install | |
cp config/config-example.js config/config.js | |
sed -i 's/backdoor = true/backdoor = false/g' config/config.js | |
sed -i 's/simulatorprocesses = 1/simulatorprocesses = 2/g' config/config.js | |
sed -i 's/.workers = 1 = 1/.workers = 2/g' config/config.js | |
- name: Start PS | |
run: cd pokemon-showdown;node pokemon-showdown start --no-security --max-old-space-size=3000 & | |
- name: Wait for server to be up | |
run: | | |
until $(curl --output /dev/null --silent --head --fail http://localhost:8000); do | |
sleep .01 | |
done | |
sleep 1 | |
- name: Run integration tests | |
run: pytest -x integration_tests/ |