Merge pull request #67 from sourceboat/dependabot/hex/phoenix_live_vi… #271
This file contains 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: | |
release: | |
types: [published] | |
env: | |
ELIXIR_VERSION: 1.15.7 | |
OTP_VERSION: 26.1.2 | |
jobs: | |
ci: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Determine the elixir version | |
run: echo "ELIXIR_VERSION=$(grep -h elixir .tool-versions | awk '{ print $2 }' | awk -F - '{print $1}')" >> $GITHUB_ENV | |
- name: Determine the otp version | |
run: echo "OTP_VERSION=$(grep -h erlang .tool-versions | awk '{ print $2 }')" >> $GITHUB_ENV | |
- uses: erlef/setup-beam@v1 | |
with: | |
elixir-version: ${{ env.ELIXIR_VERSION }} | |
otp-version: ${{ env.OTP_VERSION }} | |
- name: Restore the deps cache | |
uses: actions/cache@v4 | |
id: deps-cache | |
with: | |
path: deps | |
key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-deps-mixlockhash-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }} | |
restore-keys: | | |
${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-deps- | |
- name: Restore the _build cache | |
uses: actions/cache@v4 | |
id: build-cache | |
with: | |
path: _build | |
key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-build-mixlockhash-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }} | |
restore-keys: | | |
${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.OTP_VERSION }}-build- | |
- name: Install mix dependencies | |
if: steps.deps-cache.outputs.cache-hit != 'true' | |
run: | | |
mix local.rebar --force | |
mix local.hex --force | |
mix deps.get | |
- name: Compile dependencies | |
if: steps.deps-cache.outputs.cache-hit != 'true' | |
run: mix deps.compile | |
- name: Compile | |
run: mix compile --warnings-as-errors --force | |
- name: Check Formatting | |
run: mix format --check-formatted | |
- name: Run Tests | |
run: mix test | |
- name: Publish package | |
if: github.event_name == 'release' | |
env: | |
HEX_API_KEY: ${{ secrets.HEX_API_KEY }} | |
run: mix hex.publish --yes |