name: Check Elm

on:
  push:
    branches:
    - main
  pull_request:
    branches:
    - main

jobs:
  build:
    runs-on: ubuntu-latest
    name: Python 3.7 Elm Check Ubuntu
    steps:
      - uses: actions/checkout@v2
      - uses: actions/cache@v2
        with:
          path: ~/conda_pkgs_dir
          key: elm-env-${{ hashFiles('ci/environment-elm.yml') }}
          restore-keys: |
            elm-env-
      - name: Setup conda
        uses: conda-incubator/setup-miniconda@v2
        with:
          activate-environment: elm-xonsh-test
          environment-file: ci/environment-elm.yml
          auto-update-conda: true
          python-version: 3.7
          condarc-file: ci/condarc.yml
      - shell: bash -l {0}
        run: |
          python -m pip install . --no-deps
          pushd xonsh/webconfig
          python -m xonsh elm-compile.xsh
          popd
