CI #6791
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: [main] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| concurrency: | |
| group: mailosaur-python | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| name: Build (${{ matrix.environment }}) | |
| runs-on: ${{ vars.LINUX }} | |
| timeout-minutes: 10 | |
| strategy: | |
| fail-fast: false | |
| max-parallel: 1 | |
| matrix: | |
| environment: [live, next] | |
| env: | |
| MAILOSAUR_BASE_URL: ${{ matrix.environment == 'live' && 'https://mailosaur.com/' || 'https://next.mailosaur.com/' }} | |
| MAILOSAUR_SMTP_HOST: ${{ matrix.environment == 'live' && 'mailosaur.net' || 'mailosaur.email' }} | |
| MAILOSAUR_SMTP_PORT: 2525 | |
| MAILOSAUR_API_KEY: ${{ secrets.MAILOSAUR_API_KEY }} | |
| MAILOSAUR_SERVER: ${{ secrets.MAILOSAUR_SERVER }} | |
| MAILOSAUR_VERIFIED_DOMAIN: ${{ secrets.MAILOSAUR_VERIFIED_DOMAIN }} | |
| steps: | |
| - name: Checkout source code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ vars.PYTHON_VERSION }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
| - name: Test with pytest | |
| run: | | |
| pytest | |
| notify: | |
| name: Notify | |
| if: ${{ always() }} | |
| needs: build | |
| runs-on: ${{ vars.LINUX }} | |
| steps: | |
| - name: Checkout custom actions | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: mailosaur/actions | |
| token: ${{ secrets.CUSTOM_ACTIONS_TOKEN }} | |
| path: .github/actions | |
| - name: Send notifications | |
| uses: ./.github/actions/notify | |
| with: | |
| webhook-url: ${{ secrets.NOTIFICATION_URL }} | |
| data: '{"matrixBuildResult": "${{ needs.build.result }}"}' |