<commit_before>name: CI

on: [pull_request, push]

env:
  ELIXIR_ASSERT_TIMEOUT: 2000
  ELIXIRC_OPTS: "--warnings-as-errors"
  ERLC_OPTS: "warnings_as_errors"
  LANG: C.UTF-8

permissions:
  contents: read

jobs:
  test_linux:
    name: Linux, ${{ matrix.otp_release }}, Ubuntu 20.04
    strategy:
      fail-fast: false
      matrix:
        include:
          - otp_release: OTP-25.0
            otp_latest: true
          - otp_release: OTP-24.3
          - otp_release: OTP-24.0
          - otp_release: master
            development: true
          - otp_release: maint
            development: true
    runs-on: ubuntu-20.04
    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 50
      - name: Install Erlang/OTP
        run: |
          cd $RUNNER_TEMP
          wget -O otp.tar.gz https://repo.hex.pm/builds/otp/ubuntu-20.04/${{ matrix.otp_release }}.tar.gz
          mkdir -p otp
          tar zxf otp.tar.gz -C otp --strip-components=1
          otp/Install -minimal $(pwd)/otp
          echo "$(pwd)/otp/bin" >> $GITHUB_PATH
      - name: Compile Elixir
        run: |
          rm -rf .git
          make compile
          echo "$PWD/bin" >> $GITHUB_PATH
      - name: Build info
        run: bin/elixir --version
      - name: Check format
        run: make test_formatted && echo "All Elixir source code files are properly formatted."
      - name: Run Dialyzer
        run: dialyzer -pa lib/elixir/ebin --build_plt --output_plt elixir.plt --apps lib/elixir/ebin/elixir.beam lib/elixir/ebin/Elixir.Kernel.beam
      - name: Erlang test suite
        run: make test_erlang
        continue-on-error: ${{ matrix.development }}
      - name: Elixir test suite
        run: make test_elixir
        continue-on-error: ${{ matrix.development }}
      - name: Check reproducible builds
        run: taskset 1 make check_reproducible
        if: ${{ matrix.otp_latest }}
      - name: Build docs
        if: ${{ matrix.otp_latest }}
        run: |
          git config --global advice.detachedHead false
          EX_DOC_LATEST_STABLE_VERSION=$(curl -s https://hex.pm/api/packages/ex_doc | jq --raw-output '.latest_stable_version')
          for branch in main v${EX_DOC_LATEST_STABLE_VERSION}; do
            echo "Building docs with ExDoc ${branch}"
            cd ..
            git clone https://github.com/elixir-lang/ex_doc.git --branch ${branch} --depth 1
            cd ex_doc
            ../elixir/bin/mix do local.rebar --force + local.hex --force + deps.get + compile
            cd ../elixir/
            make docs
            rm -rf ../ex_doc/
          done

  test_windows:
    name: Windows, OTP-${{ matrix.otp_release }}, Windows Server 2019
    strategy:
      matrix:
        otp_release: ['24', '25']
    runs-on: windows-2019
    steps:
      - name: Configure Git
        run: git config --global core.autocrlf input
      - uses: actions/checkout@v3
        with:
          fetch-depth: 50
      - uses: erlef/setup-beam@v1
        with:
          otp-version: ${{ matrix.otp_release }}
      - name: Compile Elixir
        run: |
          Remove-Item -Recurse -Force '.git'
          make compile
      - name: Build info
        run: bin/elixir --version
      - name: Check format
        run: make test_formatted && echo "All Elixir source code files are properly formatted."
      - name: Erlang test suite
        run: make --keep-going test_erlang
      - name: Elixir test suite
        run: |
          Remove-Item 'c:/Windows/System32/drivers/etc/hosts'
          make --keep-going test_elixir

  check_posix_compliant:<commit_msg>Use setup beam on CI (#12131)<commit_after>name: CI

on: [pull_request, push]

env:
  ELIXIR_ASSERT_TIMEOUT: 2000
  ELIXIRC_OPTS: "--warnings-as-errors"
  ERLC_OPTS: "warnings_as_errors"
  LANG: C.UTF-8

permissions:
  contents: read

jobs:
  test_linux:
    name: Ubuntu 20.04, Erlang/OTP ${{ matrix.otp_version }}
    strategy:
      fail-fast: false
      matrix:
        include:
          - otp_version: 25.0
            otp_latest: true
          - otp_version: 24.3
          - otp_version: 24.0
          - otp_version: master
            development: true
          - otp_version: maint
            development: true
    runs-on: ubuntu-20.04
    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 50
      - uses: erlef/setup-beam@v1
        with:
          otp-version: ${{ matrix.otp_version }}
      - name: Compile Elixir
        run: |
          rm -rf .git
          make compile
          echo "$PWD/bin" >> $GITHUB_PATH
      - name: Build info
        run: bin/elixir --version
      - name: Check format
        run: make test_formatted && echo "All Elixir source code files are properly formatted."
      - name: Run Dialyzer
        run: dialyzer -pa lib/elixir/ebin --build_plt --output_plt elixir.plt --apps lib/elixir/ebin/elixir.beam lib/elixir/ebin/Elixir.Kernel.beam
      - name: Erlang test suite
        run: make test_erlang
        continue-on-error: ${{ matrix.development }}
      - name: Elixir test suite
        run: make test_elixir
        continue-on-error: ${{ matrix.development }}
      - name: Check reproducible builds
        run: taskset 1 make check_reproducible
        if: ${{ matrix.otp_latest }}
      - name: Build docs
        if: ${{ matrix.otp_latest }}
        run: |
          git config --global advice.detachedHead false
          EX_DOC_LATEST_STABLE_VERSION=$(curl -s https://hex.pm/api/packages/ex_doc | jq --raw-output '.latest_stable_version')
          for branch in main v${EX_DOC_LATEST_STABLE_VERSION}; do
            echo "Building docs with ExDoc ${branch}"
            cd ..
            git clone https://github.com/elixir-lang/ex_doc.git --branch ${branch} --depth 1
            cd ex_doc
            ../elixir/bin/mix do local.rebar --force + local.hex --force + deps.get + compile
            cd ../elixir/
            make docs
            rm -rf ../ex_doc/
          done

  test_windows:
    name: Windows Server 2019, Erlang/OTP ${{ matrix.otp_version }}
    strategy:
      matrix:
        otp_version: ['24', '25']
    runs-on: windows-2019
    steps:
      - name: Configure Git
        run: git config --global core.autocrlf input
      - uses: actions/checkout@v3
        with:
          fetch-depth: 50
      - uses: erlef/setup-beam@v1
        with:
          otp-version: ${{ matrix.otp_version }}
      - name: Compile Elixir
        run: |
          Remove-Item -Recurse -Force '.git'
          make compile
      - name: Build info
        run: bin/elixir --version
      - name: Check format
        run: make test_formatted && echo "All Elixir source code files are properly formatted."
      - name: Erlang test suite
        run: make --keep-going test_erlang
      - name: Elixir test suite
        run: |
          Remove-Item 'c:/Windows/System32/drivers/etc/hosts'
          make --keep-going test_elixir

  check_posix_compliant:
{'fraction_non_alphanumeric': 0.10648081620922546, 'fraction_numerical': 0.01451357953728984, 'mean_word_length': 1.809850625756964, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 5, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '737182', 'n_tokens_mistral': 2379, 'n_tokens_neox': 2217, 'n_words': 571}