name: Tests

on:
  pull_request:
  push:
    branches:
      - main

defaults:
  run:
    shell: bash

jobs:
  test-python:
    name: Python Linting & Tests
    strategy:
      matrix:
        python-version: ["3.7", "3.8", "3.9", "3.10"]
        os: [ubuntu-latest]
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-python@v2
        with:
          python-version: ${{ matrix.python-version }}
      - name: Install Node
        uses: actions/setup-node@v3
        with:
          node-version: '17'
      - name: Pip Cache (Linux)
        uses: actions/cache@v1
        if: runner.os == 'Linux'
        with:
          path: ~/.cache/pip
          key: ${{ runner.os }}-pip-${{ matrix.python-version }}
          restore-keys: |
            ${{ runner.os }}-pip-${{ matrix.python-version }}
      - name: Install Python Dependencies
        run: |
          python -m pip install --upgrade pip setuptools wheel
          python -m pip install --upgrade flake8 cfn_flip>=1.0.2
      - name: Install Node Dependencies
        run: npm install
      - name: Ensure spec generation and formatting fixups are clean
        run: |
          make spec
          make regen
          git diff --exit-code
      - name: Run Lints
        run: make lint
      - name: Run Tests
        run: make test

name: Tests

on:
  pull_request:
  push:
    branches:
      - main

defaults:
  run:
    shell: bash

jobs:
  test-python:
    name: Python Linting & Tests
    strategy:
      matrix:
        python-version: ["3.7", "3.8", "3.9", "3.10"]
        os: [ubuntu-latest]
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-python@v2
        with:
          python-version: ${{ matrix.python-version }}
      - name: Install Node
        uses: actions/setup-node@v3
        with:
          node-version: '17'
      - name: Pip Cache (Linux)
        uses: actions/cache@v1
        if: runner.os == 'Linux'
        with:
          path: ~/.cache/pip
          key: ${{ runner.os }}-pip-${{ matrix.python-version }}
          restore-keys: |
            ${{ runner.os }}-pip-${{ matrix.python-version }}
      - name: Install Python Dependencies
        run: |
          pip install -r requirements-dev.txt
      - name: Install Node Dependencies
        run: npm install
      - name: Ensure spec generation and formatting fixups are clean
        run: |
          make spec
          make regen
          git diff --exit-code
      - name: Run Lints
        run: make lint
      - name: Run Tests
        run: make test

Install development dependencies when testing
Install development dependencies when testing
