name: reflex-init-in-docker-test

on:
  push:
    branches: [ "main" ]
    paths-ignore:
      - '**/*.md'
  pull_request:
    branches:
      - main
    paths-ignore:
      - '**/*.md'

jobs:
  # TODO we can extend to various starting points (e.g. Ubuntu with node, without node, with unzip, without unzip, etc.)
  # Currently starting point is: Ubuntu + unzip, xz-utils, Python suite.  No node.
  reflex-install-and-init:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v3

    - shell: bash
      run: |
        # Run reflex init in a docker container
 
        # cwd is repo root
        docker build -f integration/init-test/Dockerfile -t reflex-init-test integration/init-test
        docker run --rm -v $(pwd):/reflex-repo/ reflex-init-test /reflex-repo/integration/init-test/in_docker_test_script.sh
