# This is a basic workflow to help you get started with Actions

name: CI

# Controls when the workflow will run
on:
  push:
  pull_request:
  workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
  vezzal:
    # The type of runner that the job will run on
    runs-on: ubuntu-latest
    # Steps represent a sequence of tasks that will be executed as part of the job
    steps:
      - name: Pulling the docker image
        run: docker pull vezzal/vezzal:v1
        
      - name: Start the container with the docker image
        run: docker run -id --name test_magic vezzal/vezzal:v1 bash | exit
        
      - name: Run the testing on the container and send the mail
        run: docker exec test_magic /vezzal/test_magic.sh "lankasaicharan123@gmail.com,tim@opencircuitdesign.com" ${{secrets.MAILING_KEY}}
  simple_build_linux:
    runs-on: ubuntu-20.04
    steps:
      - uses: actions/checkout@v2
      - name: Get Dependencies
        run: |
          sudo apt-get install -y tcl-dev tk-dev libcairo-dev csh
      - name: Build
        run: |
          ./configure
          make database/database.h
          make -j$(nproc)
  # simple_build_mac:
  #   runs-on: macos-11
  #   steps:
  #     - uses: actions/checkout@v2
  #     - name: Get Dependencies
  #       run: |
  #         brew install --cask xquartz
  #         brew install cairo tcl-tk tcsh
  #     - name: Build
  #       run: |
  #         export PATH="/opt/X11/bin:$PATH"
  #         ./scripts/configure_mac
  #         make database/database.h
  #         make -j$(sysctl -n hw.ncpu)