diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6562b27..80272e4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,14 +1,46 @@ -name: Publish SDK - -# Only trigger, when the test workflow succeeds -on: - push: - branches: - - main +name: ci +on: [push] jobs: + compile: + runs-on: ubuntu-20.04 + steps: + - name: Checkout repo + uses: actions/checkout@v3 + - name: Set up python + uses: actions/setup-python@v4 + with: + python-version: 3.7 + - name: Bootstrap poetry + run: | + curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1 + - name: Install dependencies + run: poetry install + - name: Compile + run: poetry run mypy . + test: + runs-on: ubuntu-20.04 + steps: + - name: Checkout repo + uses: actions/checkout@v3 + - name: Set up python + uses: actions/setup-python@v4 + with: + python-version: 3.7 + - name: Bootstrap poetry + run: | + curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1 + - name: Install dependencies + run: | + poetry install + - name: Test + run: poetry run pytest . + env: + ELEVEN_API_KEY: ${{ secrets.TEST_API_KEY }} + publish: - if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') && github.event.workflow_run.conclusion == 'success' + needs: [compile, test] + if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') runs-on: ubuntu-20.04 steps: - name: Checkout repo @@ -16,7 +48,7 @@ jobs: - name: Set up python uses: actions/setup-python@v4 with: - python-version: 3.8 + python-version: 3.7 - name: Bootstrap poetry run: | curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1