Refactor client #103
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| name: CI | |
| on: | |
| push: | |
| branches: [master] | |
| pull_request: | |
| branches: [master] | |
| permissions: | |
| contents: read | |
| jobs: | |
| pre-commit: | |
| name: Lint & Format | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.13' # Specify a Python version explicitly | |
| - uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1 | |
| test: | |
| name: Test py${{ matrix.python-version }} on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| defaults: | |
| run: | |
| shell: bash -el {0} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: ["ubuntu-latest", "macos-latest", "windows-latest"] | |
| python-version: ["3.10", "3.11", "3.12", "3.13"] | |
| env: | |
| MJ_APIKEY_PUBLIC: ${{ secrets.MJ_APIKEY_PUBLIC }} | |
| MJ_APIKEY_PRIVATE: ${{ secrets.MJ_APIKEY_PRIVATE }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 # Get full history with tags (required for setuptools-scm) | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: conda-incubator/setup-miniconda@fc2d68f6413eb2d87b895e92f8584b5b94a10167 # v3.3.0 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| channels: defaults | |
| show-channel-urls: true | |
| environment-file: environment.yaml | |
| cache: 'pip' # Drastically speeds up CI by caching pip dependencies | |
| - name: Install dependencies and package | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install . | |
| conda info | |
| - name: Test package imports | |
| run: python -c "import mailjet_rest" | |
| - name: Install test dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install pytest | |
| - name: Run Unit & Integration Tests | |
| run: pytest tests/ -v |