Created
October 29, 2025 03:28
-
-
Save john-eevee/546669ee84ee0d850278e272188cdfdb to your computer and use it in GitHub Desktop.
Sample Elixir Github CI
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
| # This workflow uses actions that are not certified by GitHub. | |
| # They are provided by a third-party and are governed by | |
| # separate terms of service, privacy policy, and support | |
| # documentation. | |
| name: Elixir CI | |
| on: | |
| push: | |
| branches: ["main"] | |
| pull_request: | |
| branches: ["main"] | |
| permissions: | |
| contents: read | |
| env: | |
| MIX_ENV: test | |
| jobs: | |
| test: | |
| name: Test on Elixir ${{matrix.elixir}} - OTP ${{matrix.otp}} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Cache deps | |
| id: cache-deps | |
| uses: actions/cache@v4 | |
| env: | |
| cache-name: cache-elixir-deps | |
| with: | |
| path: deps | |
| key: ${{ runner.os }}-mix-${{ env.cache-name }}-${{ hashFiles('**/mix.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-mix-${{ env.cache-name }}- | |
| - name: Cache compiled build | |
| id: cache-build | |
| uses: actions/cache@v4 | |
| env: | |
| cache-name: cache-compiled-build | |
| with: | |
| path: _build | |
| key: ${{ runner.os }}-mix-${{ env.cache-name }}-${{ hashFiles('**/mix.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-mix-${{ env.cache-name }}- | |
| ${{ runner.os }}-mix- | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Elixir | |
| uses: erlef/setup-beam@v1 | |
| with: | |
| elixir-version: "1.19" | |
| otp-version: "28" | |
| - name: Clean to rule out incremental build as a source of flakiness | |
| if: github.run_attempt != '1' | |
| run: | | |
| mix deps.clean --all | |
| mix clean | |
| shell: sh | |
| - name: Run CI | |
| run: mix ci |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment