ci: bump actions/upload-artifact from 3 to 5 #4
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, develop ] | |
| pull_request: | |
| branches: [ main, develop ] | |
| env: | |
| MIX_ENV: test | |
| ELIXIR_VERSION: '1.15' | |
| OTP_VERSION: '26.0' | |
| jobs: | |
| test: | |
| name: Test (Elixir ${{ matrix.elixir }} / OTP ${{ matrix.otp }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| elixir: ['1.14', '1.15', '1.16'] | |
| otp: ['25.0', '26.0'] | |
| exclude: | |
| - elixir: '1.14' | |
| otp: '26.0' | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Elixir | |
| uses: erlef/setup-beam@v1 | |
| with: | |
| elixir-version: ${{ matrix.elixir }} | |
| otp-version: ${{ matrix.otp }} | |
| - name: Restore dependencies cache | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| deps | |
| _build | |
| key: ${{ runner.os }}-mix-${{ matrix.elixir }}-${{ matrix.otp }}-${{ hashFiles('**/mix.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-mix-${{ matrix.elixir }}-${{ matrix.otp }}- | |
| - name: Install dependencies | |
| run: mix deps.get | |
| - name: Compile dependencies | |
| run: mix deps.compile | |
| - name: Compile application | |
| run: mix compile --warnings-as-errors | |
| - name: Run tests | |
| run: mix test | |
| - name: Run tests with coverage | |
| run: mix test --cover | |
| if: matrix.elixir == '1.15' && matrix.otp == '26.0' | |
| code_quality: | |
| name: Code Quality | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Elixir | |
| uses: erlef/setup-beam@v1 | |
| with: | |
| elixir-version: ${{ env.ELIXIR_VERSION }} | |
| otp-version: ${{ env.OTP_VERSION }} | |
| - name: Restore dependencies cache | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| deps | |
| _build | |
| key: ${{ runner.os }}-mix-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ hashFiles('**/mix.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-mix-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}- | |
| - name: Install dependencies | |
| run: mix deps.get | |
| - name: Check formatting | |
| run: mix format --check-formatted | |
| - name: Run Credo | |
| run: mix credo --strict | |
| build: | |
| name: Build Escript | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Elixir | |
| uses: erlef/setup-beam@v1 | |
| with: | |
| elixir-version: ${{ env.ELIXIR_VERSION }} | |
| otp-version: ${{ env.OTP_VERSION }} | |
| - name: Restore dependencies cache | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| deps | |
| _build | |
| key: ${{ runner.os }}-mix-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-${{ hashFiles('**/mix.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-mix-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}- | |
| - name: Install dependencies | |
| run: mix deps.get | |
| - name: Build escript | |
| run: mix escript.build | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: chat_simulator | |
| path: chat_simulator | |
| - name: Test escript | |
| run: | | |
| chmod +x chat_simulator | |
| echo "quit" | ./chat_simulator || true |