Repository navigation
Merge pull request #245 from ericmj/ericmj/publish-size #267
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] | |
| schedule: | |
| - cron: "0 0 1 */1 *" | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| name: Elixir ${{ matrix.pair.elixir }} / OTP ${{ matrix.pair.otp }} / NATS ${{ matrix.pair.nats }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| pair: | |
| - otp: "26" | |
| elixir: "1.16" | |
| nats: "2.10.24" | |
| - otp: "27" | |
| elixir: "1.17" | |
| nats: "2.11.17" | |
| - otp: "27" | |
| elixir: "1.18" | |
| nats: "2.12.8" | |
| - otp: "28" | |
| elixir: "1.18" | |
| nats: "2.10.24" | |
| - otp: "28" | |
| elixir: "1.18" | |
| nats: "2.11.17" | |
| features: [message_ttl] | |
| - otp: "28" | |
| elixir: "1.19" | |
| nats: "2.14.0" | |
| features: [format, dialyzer, message_ttl] | |
| env: | |
| MIX_ENV: test | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Elixir | |
| uses: erlef/setup-beam@v1 | |
| with: | |
| elixir-version: ${{ matrix.pair.elixir }} | |
| otp-version: ${{ matrix.pair.otp }} | |
| - name: Start NATS Jetstream | |
| run: docker run --rm -d --network host nats:${{ matrix.pair.nats }} -js | |
| - name: Restore deps cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| deps | |
| _build | |
| key: deps-${{ matrix.pair.otp }}-${{ matrix.pair.elixir }}-${{ hashFiles('mix.lock') }} | |
| - name: Install package dependencies | |
| run: mix deps.get | |
| - name: Check for valid formatting | |
| if: contains(matrix.pair.features, 'format') | |
| run: mix format --check-formatted | |
| - name: Run unit tests | |
| run: mix test --color | |
| - name: Run Message TTL Tests | |
| if: contains(matrix.pair.features, 'message_ttl') | |
| run: mix test --only message_ttl | |
| - name: Cache Dialyzer PLTs | |
| if: contains(matrix.pair.features, 'dialyzer') | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| priv/plts/*.plt | |
| priv/plts/*.plt.hash | |
| key: dialyzer-${{ matrix.pair.otp }}-${{ matrix.pair.elixir }}-${{ hashFiles('mix.lock') }} | |
| restore-keys: | | |
| dialyzer-${{ matrix.pair.otp }}-${{ matrix.pair.elixir }}- | |
| - name: Run Dialyzer | |
| if: contains(matrix.pair.features, 'dialyzer') | |
| env: | |
| MIX_ENV: dev | |
| run: | | |
| mix dialyzer |