UI Improvements #258
Workflow file for this run
This file contains hidden or 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
| # This workflow will install Python dependencies, run tests and lint with a single version of Python | |
| # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
| name: Build | |
| on: | |
| push: | |
| branches: [master] | |
| pull_request: | |
| branches: [master, staging] | |
| jobs: | |
| build-docker: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build the UI Docker image | |
| run: docker build ui/ -t bcollazo/catanatron-react-ui:latest | |
| - name: Build the Server Docker image | |
| run: docker build . -f Dockerfile.web -t bcollazo/catanatron-server:latest | |
| # - name: Build the Paperspace Docker image | |
| # run: docker build . -f Dockerfile.paperspace -t bcollazo/paperspace-rl | |
| build-python: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.11", "3.12"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: "pip" # caching pip dependencies | |
| - name: Install core | |
| run: | # TODO: Move to python -m build and an automated release(?) | |
| pip install . | |
| - name: Run sample catanatron-play | |
| run: | | |
| catanatron-play --players=R,W,F,AB:2 --num=2 | |
| - name: Test Custom Bot | |
| run: | | |
| catanatron-play --code=examples/custom_player.py --players=F,FOO --num=1 | |
| - name: Test Custom Accumulator | |
| run: | | |
| catanatron-play --code=examples/custom_accumulator.py --players=F,R --num=1 | |
| - name: Test Library Example | |
| run: | | |
| python -W error examples/library_example.py | |
| - name: Install Gym | |
| run: | | |
| pip install .[gym] | |
| - name: Test Gym Inline | |
| run: | | |
| python -c "import gymnasium; import catanatron.gym; env = gymnasium.make('catanatron/Catanatron-v0')" | |
| - name: Test README.md sample (and fail even on warnings) | |
| run: | | |
| python -W error examples/gym_example.py && \ | |
| python -W error examples/gym_vectorized_example.py | |
| - name: Install the rest of the dependencies | |
| run: | | |
| pip install .[web,dev] | |
| - name: Lint with black | |
| run: | | |
| black catanatron --check | |
| black catanatron_experimental --check | |
| - name: Test with pytest | |
| run: | | |
| coverage run --source=catanatron -m pytest tests/ | |
| - name: Coveralls | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| coveralls --service=github | |
| build-ui: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Find Node.js version | |
| id: node-version | |
| run: echo "node-version=$(cat ui/.nvmrc)" >> $GITHUB_OUTPUT | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ steps.node-version.outputs.node-version }} | |
| - run: npm ci | |
| working-directory: ./ui | |
| - run: npm run build | |
| working-directory: ./ui |