From 43277cc3c80985f39cace2ec0233e1a079416ab7 Mon Sep 17 00:00:00 2001 From: Alexandre Hamez Date: Fri, 4 Oct 2024 19:42:02 +0200 Subject: [PATCH] style: format YAML files --- .github/dependabot.yml | 12 +- .github/workflows/elixir.yml | 159 ++++++++++++------------- .github/workflows/mutation_testing.yml | 65 +++++----- 3 files changed, 117 insertions(+), 119 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index c6b225d5..e78c12ad 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,8 +1,8 @@ version: 2 updates: -- package-ecosystem: mix - directory: "/" - schedule: - interval: daily - time: "04:00" - open-pull-requests-limit: 10 + - package-ecosystem: mix + directory: "/" + schedule: + interval: daily + time: "04:00" + open-pull-requests-limit: 10 diff --git a/.github/workflows/elixir.yml b/.github/workflows/elixir.yml index a03cd2c8..586e8512 100644 --- a/.github/workflows/elixir.yml +++ b/.github/workflows/elixir.yml @@ -1,21 +1,20 @@ name: Elixir CI env: - PROTOBUF_VERSION: '21.4' - PROTOBUF_LIB_VERSION_MAJOR: '32' - PROTOBUF_LIB_VERSION_MINOR: '0.4' + PROTOBUF_VERSION: "21.4" + PROTOBUF_LIB_VERSION_MAJOR: "32" + PROTOBUF_LIB_VERSION_MINOR: "0.4" GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} MIX_ENV: test on: push: - branches: [ "**" ] + branches: ["**"] pull_request: - branches: [ "**" ] + branches: ["**"] jobs: build: - runs-on: ubuntu-20.04 name: OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}} strategy: @@ -38,77 +37,77 @@ jobs: check_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@v3 - with: - path: deps - key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles('**/mix.lock') }} - - - name: Restore PLT cache - uses: actions/cache@v3 - with: - path: priv/plts - key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles('**/mix.lock') }} - - - name: Restore conformance-test-runner - uses: actions/cache@v3 - id: compile-conformance-test-runner - with: - path: conformance-bin - key: ${{ runner.os }}-protobuf-${{ env.PROTOBUF_VERSION }} - - - name: Compile conformance-test-runner - if: steps.compile-conformance-test-runner.outputs.cache-hit != 'true' - run: | - mkdir -p ./conformance-bin/.libs - wget https://github.com/protocolbuffers/protobuf/archive/v${{ env.PROTOBUF_VERSION }}.tar.gz - tar xf v${{ env.PROTOBUF_VERSION }}.tar.gz - cd protobuf-${{ env.PROTOBUF_VERSION }} - ./autogen.sh && ./configure --disable-maintainer-mode --disable-dependency-tracking --disable-static - make -C ./src protoc - make -C conformance - cp ./conformance/.libs/conformance-test-runner ../conformance-bin - cp ./src/.libs/libprotobuf.so.${{ env.PROTOBUF_LIB_VERSION_MAJOR }}.${{ env.PROTOBUF_LIB_VERSION_MINOR }} ../conformance-bin/.libs/libprotobuf.so.${{ env.PROTOBUF_LIB_VERSION_MAJOR }} - - - name: Install protoc - run: | - wget https://github.com/protocolbuffers/protobuf/releases/download/v24.4/protoc-24.4-linux-x86_64.zip - unzip -d protoc protoc-24.4-linux-x86_64.zip - echo "${PWD}/protoc/bin" >> $GITHUB_PATH - - - name: Install dependencies - run: | - mix local.rebar --force - mix local.hex --force - mix deps.get - - - name: Compile prod with warnings as errors - run: MIX_ENV=prod mix compile --warnings-as-errors - - - name: Run tests - env: - PROTOBUF_CONFORMANCE_RUNNER: conformance-bin/conformance-test-runner - LD_LIBRARY_PATH: conformance-bin/.libs - run: mix coveralls.github --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 + - 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 + key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles('**/mix.lock') }} + + - name: Restore PLT cache + uses: actions/cache@v3 + with: + path: priv/plts + key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles('**/mix.lock') }} + + - name: Restore conformance-test-runner + uses: actions/cache@v3 + id: compile-conformance-test-runner + with: + path: conformance-bin + key: ${{ runner.os }}-protobuf-${{ env.PROTOBUF_VERSION }} + + - name: Compile conformance-test-runner + if: steps.compile-conformance-test-runner.outputs.cache-hit != 'true' + run: | + mkdir -p ./conformance-bin/.libs + wget https://github.com/protocolbuffers/protobuf/archive/v${{ env.PROTOBUF_VERSION }}.tar.gz + tar xf v${{ env.PROTOBUF_VERSION }}.tar.gz + cd protobuf-${{ env.PROTOBUF_VERSION }} + ./autogen.sh && ./configure --disable-maintainer-mode --disable-dependency-tracking --disable-static + make -C ./src protoc + make -C conformance + cp ./conformance/.libs/conformance-test-runner ../conformance-bin + cp ./src/.libs/libprotobuf.so.${{ env.PROTOBUF_LIB_VERSION_MAJOR }}.${{ env.PROTOBUF_LIB_VERSION_MINOR }} ../conformance-bin/.libs/libprotobuf.so.${{ env.PROTOBUF_LIB_VERSION_MAJOR }} + + - name: Install protoc + run: | + wget https://github.com/protocolbuffers/protobuf/releases/download/v24.4/protoc-24.4-linux-x86_64.zip + unzip -d protoc protoc-24.4-linux-x86_64.zip + echo "${PWD}/protoc/bin" >> $GITHUB_PATH + + - name: Install dependencies + run: | + mix local.rebar --force + mix local.hex --force + mix deps.get + + - name: Compile prod with warnings as errors + run: MIX_ENV=prod mix compile --warnings-as-errors + + - name: Run tests + env: + PROTOBUF_CONFORMANCE_RUNNER: conformance-bin/conformance-test-runner + LD_LIBRARY_PATH: conformance-bin/.libs + run: mix coveralls.github --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 diff --git a/.github/workflows/mutation_testing.yml b/.github/workflows/mutation_testing.yml index 9e988aac..be9d27fc 100644 --- a/.github/workflows/mutation_testing.yml +++ b/.github/workflows/mutation_testing.yml @@ -5,11 +5,10 @@ env: on: push: - branches: [ "**" ] + branches: ["**"] jobs: build: - runs-on: ubuntu-20.04 name: OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}} strategy: @@ -20,34 +19,34 @@ jobs: otp: 25.1 steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 30 - - - 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 - key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles('**/mix.lock') }} - - - name: Install protoc - run: | - wget https://github.com/protocolbuffers/protobuf/releases/download/v21.4/protoc-21.4-linux-x86_64.zip - unzip -d protoc protoc-21.4-linux-x86_64.zip - echo "${PWD}/protoc/bin" >> $GITHUB_PATH - - - name: Run mutation testing - env: - PROTOX_MUZAK_PRO_CREDS: ${{ secrets.PROTOX_MUZAK_PRO_CREDS }} - MIX_ENV: test - run: | - mix local.rebar --force - mix local.hex --force - mix deps.get - mix muzak --profile ci + - uses: actions/checkout@v4 + with: + fetch-depth: 30 + + - 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 + key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles('**/mix.lock') }} + + - name: Install protoc + run: | + wget https://github.com/protocolbuffers/protobuf/releases/download/v21.4/protoc-21.4-linux-x86_64.zip + unzip -d protoc protoc-21.4-linux-x86_64.zip + echo "${PWD}/protoc/bin" >> $GITHUB_PATH + + - name: Run mutation testing + env: + PROTOX_MUZAK_PRO_CREDS: ${{ secrets.PROTOX_MUZAK_PRO_CREDS }} + MIX_ENV: test + run: | + mix local.rebar --force + mix local.hex --force + mix deps.get + mix muzak --profile ci