### Setup Gleam and OTP on Ubuntu Source: https://github.com/erlef/setup-beam/blob/main/README.md Configure Gleam and Erlang/OTP for CI on Ubuntu. This example installs Gleam version 1.9.0 with OTP version 27. ```yaml # create this in .github/workflows/ci.yml on: push jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: erlef/setup-beam@v1 with: otp-version: '27' gleam-version: '1.9.0' - run: gleam test ``` -------------------------------- ### Setup Rebar3 and OTP on Windows Source: https://github.com/erlef/setup-beam/blob/main/README.md Configure Rebar3 and Erlang/OTP for CI on Windows. This example specifies exact versions for OTP and Rebar3. ```yaml # create this in .github/workflows/ci.yml on: push jobs: test: runs-on: windows-2025 steps: - uses: actions/checkout@v4 - uses: erlef/setup-beam@v1 with: otp-version: '24' rebar3-version: '3.16.1' - run: rebar3 ct ``` -------------------------------- ### Basic gleamgleam Usage Example Source: https://github.com/erlef/setup-beam/blob/main/test/projects/gleamgleam/README.md A minimal example demonstrating how to import and use the gleamgleam module in a Gleam project. This serves as a starting point for integrating the library. ```gleam import gleamgleam pub fn main() { // TODO: An example of the project in use } ``` -------------------------------- ### Specify OTP Architecture on Windows Source: https://github.com/erlef/setup-beam/blob/main/README.md On Windows, you can specify the desired architecture for the Erlang/OTP installation. This example installs the 32-bit version. ```yaml # create this in .github/workflows/ci.yml on: push jobs: test: runs-on: windows-latest steps: - uses: erlef/setup-beam@v1 with: otp-version: '26' otp-architecture: '32' ``` -------------------------------- ### Setup Rebar3 and OTP on Ubuntu Source: https://github.com/erlef/setup-beam/blob/main/README.md Configure Rebar3 and Erlang/OTP for CI on Ubuntu. This example is suitable for projects using Rebar3 for dependency management and testing. ```yaml # create this in .github/workflows/ci.yml on: push jobs: test: runs-on: ubuntu-24.04 name: Erlang/OTP ${{matrix.otp}} / rebar3 ${{matrix.rebar3}} strategy: matrix: otp: ['25.3.2', '26.2.5', '27.3.3'] rebar3: ['3.23.0', '3.24.0'] steps: - uses: actions/checkout@v4 - uses: erlef/setup-beam@v1 with: otp-version: ${{matrix.otp}} rebar3-version: ${{matrix.rebar3}} - run: rebar3 ct ``` -------------------------------- ### Setup Rebar3 and OTP on macOS Source: https://github.com/erlef/setup-beam/blob/main/README.md Configure Rebar3 and Erlang/OTP for CI on macOS. This example specifies exact versions for OTP and Rebar3. ```yaml # create this in .github/workflows/ci.yml on: push jobs: test: runs-on: macos-15 steps: - uses: actions/checkout@v4 - uses: erlef/setup-beam@v1 with: otp-version: '28' rebar3-version: '3.25' - run: rebar3 ct ``` -------------------------------- ### Setup Elixir and OTP on Ubuntu Source: https://github.com/erlef/setup-beam/blob/main/README.md Use this snippet to set up Elixir and Erlang/OTP for CI on Ubuntu. It supports matrix testing for different OTP and Elixir versions. ```yaml # create this in .github/workflows/ci.yml on: push jobs: test: runs-on: ubuntu-24.04 name: OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}} strategy: matrix: otp: ['25.3.2', '26.2.5', '27.3.3'] elixir: ['1.17.3', '1.18.3'] steps: - uses: actions/checkout@v4 - uses: erlef/setup-beam@v1 with: otp-version: ${{matrix.otp}} elixir-version: ${{matrix.elixir}} - run: mix deps.get - run: mix test ``` -------------------------------- ### Setup Gleam on Ubuntu without OTP Source: https://github.com/erlef/setup-beam/blob/main/README.md Install Gleam on Ubuntu without installing Erlang/OTP. This is useful for projects that only require Gleam and not its underlying OTP dependencies. ```yaml # create this in .github/workflows/ci.yml on: push jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: erlef/setup-beam@v1 with: otp-version: false gleam-version: '1.9.0' - run: gleam check ``` -------------------------------- ### Install gleamgleam Package Source: https://github.com/erlef/setup-beam/blob/main/test/projects/gleamgleam/README.md Install the gleamgleam package and version 1 using the gleam package manager. ```sh gleam add gleamgleam@1 ``` -------------------------------- ### Use Alternative Hex.pm Mirror Source: https://github.com/erlef/setup-beam/blob/main/README.md Configure the action to use an alternative hex.pm mirror, such as `cdn.jsdelivr.net/hex`, for package installations. This is useful if the default mirror is unavailable or slow. ```yaml # create this in .github/workflows/ci.yml on: push jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: erlef/setup-beam@v1 with: otp-version: '26' # Use `cdn.jsdelivr.net/hex` as an alternative to `builds.hex.pm` hexpm-mirrors: https://cdn.jsdelivr.net/hex ``` -------------------------------- ### Development Commands for gleamgleam Source: https://github.com/erlef/setup-beam/blob/main/test/projects/gleamgleam/README.md Commands to run the project or its tests during development. Ensure you have Gleam installed to use these commands. ```sh gleam run # Run the project ``` ```sh gleam test # Run the tests ``` -------------------------------- ### Setup with Specific Dependency Versions for Compatibility Source: https://github.com/erlef/setup-beam/blob/main/README.md Use this configuration for matrix testing with pinned, compatible releases of Erlang/OTP and Rebar3. Ensures stability by using exact versions. ```yaml test: runs-on: ${{matrix.compat.os}} name: Erlang/OTP ${{matrix.compat.otp}} / rebar3 ${{matrix.compat.rebar3}} strategy: matrix: compat: - otp: "26.2.5.5" rebar3: "3.22.1" os: ubuntu-24.04 - otp: "27.1.2" rebar3: "3.22.1" os: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: erlef/setup-beam@v1 with: otp-version: ${{matrix.compat.otp}} rebar3-version: ${{matrix.compat.rebar3}} version-type: strict - run: rebar3 eunit ``` -------------------------------- ### Configure Self-Hosted Runner with ImageOS Source: https://github.com/erlef/setup-beam/blob/main/README.md When using self-hosted runners, set the `ImageOS` environment variable to match the operating system. This example uses `ubuntu24` for `ubuntu-24.04`. ```yaml jobs: test: runs-on: self-hosted env: ImageOS: ubuntu24 # equivalent to runs-on ubuntu-24.04 steps: - uses: actions/checkout@v4 - uses: erlef/setup-beam@v1 ... ``` -------------------------------- ### Use Multiple Alternative Hex.pm Mirrors Source: https://github.com/erlef/setup-beam/blob/main/README.md Specify multiple alternative hex.pm mirrors in order of preference. The action will attempt to use them sequentially if the primary mirror fails. ```yaml # create this in .github/workflows/ci.yml on: push jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: erlef/setup-beam@v1 with: otp-version: '26' hexpm-mirrors: | https://builds.hex.pm https://cdn.jsdelivr.net/hex ``` -------------------------------- ### Export GitHub Token for Tests Source: https://github.com/erlef/setup-beam/blob/main/CONTRIBUTING.md Before running tests locally, export your GitHub token with the 'repo' scope as an environment variable. This is required for the tests to pass. ```bash export GITHUB_TOKEN= ``` -------------------------------- ### Add Dependency to mix.exs Source: https://github.com/erlef/setup-beam/blob/main/test/projects/elixir_mix/README.md Add the `test` package to your project's dependencies in the `mix.exs` file. This ensures the package is available for your project. ```elixir def deps do [ {:test, "~> 0.1.0"} ] end ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.