misc: ignore local lefthook config #886
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: Elixir CI | |
env: | |
PROTOX_PROTOBUF_VERSION: "29.2" | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
MIX_ENV: test | |
on: | |
push: | |
branches: ["**"] | |
pull_request: | |
branches: ["**"] | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
name: OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- elixir: "1.15" | |
otp: "26" | |
dialyzer: true | |
- elixir: "1.16" | |
otp: "26" | |
dialyzer: true | |
- elixir: "1.17" | |
otp: "27" | |
check_format: true | |
check_deps: true | |
dialyzer: true | |
- elixir: "1.17" | |
otp: "27" | |
check_format: true | |
check_deps: true | |
dialyzer: true | |
unlock_deps: true | |
steps: | |
- 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@v4 | |
with: | |
path: deps | |
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles('**/mix.lock') }} | |
- name: Restore PLT cache | |
uses: actions/cache@v4 | |
with: | |
path: priv/plts | |
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles('**/mix.lock') }} | |
# - name: Restore conformance_test_runner cache | |
# uses: actions/cache@v4 | |
# id: restore_conformance_test_runner | |
# with: | |
# path: conformance_test_runner | |
# key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-protobuf-${{ env.PROTOX_PROTOBUF_VERSION }} | |
- name: Unlock all dependencies | |
run: mix deps.unlock --all | |
if: ${{ matrix.unlock_deps }} | |
- name: Install dependencies | |
run: | | |
mix local.rebar --force | |
mix local.hex --force | |
mix deps.get | |
- name: Install protoc | |
run: | | |
wget https://github.com/protocolbuffers/protobuf/releases/download/v${{ env.PROTOX_PROTOBUF_VERSION }}/protoc-${{ env.PROTOX_PROTOBUF_VERSION }}-linux-x86_64.zip | |
unzip -d protoc protoc-${{ env.PROTOX_PROTOBUF_VERSION }}-linux-x86_64.zip | |
echo "${PWD}/protoc/bin" >> $GITHUB_PATH | |
- name: Compile prod with warnings as errors | |
run: MIX_ENV=prod mix compile --warnings-as-errors | |
# - name: Compile conformance-test-runner | |
# if: steps.restore_conformance_test_runner.outputs.cache-hit != 'true' | |
# run: | | |
# mix protox.conformance --compile-only | |
# cp ./deps/protobuf/conformance_test_runner ./conformance_test_runner | |
# - name: Restore conformance-test-runner from cache | |
# if: steps.restore_conformance_test_runner.outputs.cache-hit == 'true' | |
# run: | | |
# mkdir -p ./deps/protobuf | |
# cp ./conformance_test_runner ./deps/protobuf/conformance_test_runner | |
- name: Run tests | |
run: mix coveralls.github --timeout 600000 --include conformance | |
- name: Check formatting | |
run: mix format --check-formatted | |
if: ${{ matrix.check_format }} | |
- name: Check dependencies | |
run: mix deps.unlock --check-unused | |
if: ${{ matrix.check_deps }} | |
- name: Credo | |
run: mix credo | |
- name: Dialyzer | |
run: mix dialyzer | |
if: ${{ matrix.dialyzer }} |