Prepare 1.2.2 release #260
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: [main] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| inputs: | |
| run_contract_validation: | |
| description: Run live Stripe contract and drift validation | |
| required: false | |
| default: false | |
| type: boolean | |
| jobs: | |
| quality: | |
| name: Quality Checks | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| otp: ['27.3.4.14'] | |
| elixir: ['1.18.4', '1.19.5', '1.20.2'] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Elixir | |
| uses: erlef/setup-beam@v1 | |
| with: | |
| otp-version: ${{ matrix.otp }} | |
| elixir-version: ${{ matrix.elixir }} | |
| - name: Cache dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| deps | |
| _build | |
| key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }} | |
| restore-keys: ${{ runner.os }}-mix- | |
| - name: Install dependencies | |
| run: mix deps.get | |
| - name: Compile (warnings as errors) | |
| run: mix compile --warnings-as-errors | |
| env: | |
| MIX_ENV: test | |
| - name: Check formatting | |
| run: mix format --check-formatted | |
| - name: Run Credo (strict) | |
| run: mix credo --strict --all | |
| - name: Cache Dialyzer PLT | |
| uses: actions/cache@v4 | |
| with: | |
| path: priv/plts | |
| key: ${{ runner.os }}-plt-${{ hashFiles('**/mix.lock') }} | |
| restore-keys: ${{ runner.os }}-plt- | |
| - name: Run Dialyzer | |
| run: mix dialyzer | |
| - name: Run tests | |
| run: mix test --warnings-as-errors | |
| hackney-1x-compat: | |
| name: Hackney 1.x Compatibility | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Elixir | |
| uses: erlef/setup-beam@v1 | |
| with: | |
| otp-version: '27.3.4.14' | |
| elixir-version: '1.20.2' | |
| # The main suite can never exercise the hackney ~> 1.24 branch because | |
| # the test-only stripity_stripe dep forces hackney 4.x resolution. This | |
| # standalone project pins hackney 1.x and smoke-tests the adapter. | |
| - name: Install dependencies | |
| run: mix deps.get | |
| working-directory: integration/hackney_1x_smoke | |
| - name: Run hackney 1.x smoke test | |
| run: mix run smoke.exs | |
| working-directory: integration/hackney_1x_smoke | |
| env: | |
| PAPER_TIGER_START: 'true' | |
| contract-validation: | |
| name: Contract Validation (Stripe API) | |
| runs-on: ubuntu-latest | |
| if: ${{ github.event_name == 'workflow_dispatch' && inputs.run_contract_validation }} | |
| strategy: | |
| matrix: | |
| otp: ['27.3.4.14'] | |
| elixir: ['1.18.4', '1.20.2'] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Elixir | |
| uses: erlef/setup-beam@v1 | |
| with: | |
| otp-version: ${{ matrix.otp }} | |
| elixir-version: ${{ matrix.elixir }} | |
| - name: Cache dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| deps | |
| _build | |
| key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }} | |
| restore-keys: ${{ runner.os }}-mix- | |
| - name: Install dependencies | |
| run: mix deps.get | |
| - name: Check Stripe API key secret | |
| id: stripe_secret | |
| run: | | |
| if [ -z "$STRIPE_API_KEY" ]; then | |
| echo "configured=false" >> "$GITHUB_OUTPUT" | |
| echo "STRIPE_TEST_API_KEY is not configured; skipping live contract validation." | |
| else | |
| echo "configured=true" >> "$GITHUB_OUTPUT" | |
| fi | |
| env: | |
| STRIPE_API_KEY: ${{ secrets.STRIPE_TEST_API_KEY }} | |
| - name: Run contract tests against Stripe | |
| if: steps.stripe_secret.outputs.configured == 'true' | |
| run: | | |
| mix test \ | |
| test/paper_tiger/contract_test.exs \ | |
| test/paper_tiger/contract/payment_intent_chain_test.exs \ | |
| test/paper_tiger/contract_drift_test.exs | |
| env: | |
| STRIPE_API_KEY: ${{ secrets.STRIPE_TEST_API_KEY }} | |
| VALIDATE_AGAINST_STRIPE: true | |
| VALIDATE_CONTRACT_DRIFT: true |