Update rustler and rustler_precompiled #38
Workflow file for this run
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: | |
branches: [main] | |
pull_request: | |
branches: ["**"] | |
jobs: | |
check-formatting: | |
name: Check formatting | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
components: rustfmt | |
- name: Set up Elixir | |
uses: erlef/setup-beam@v1 | |
with: | |
otp-version: 25.0 | |
elixir-version: 1.14.0 | |
- name: Check Rust formatting | |
working-directory: native/meeseeks_html5ever_nif | |
run: cargo fmt --all -- --check | |
- name: Check Elixir formatting | |
run: mix format --check-formatted | |
test-elixir: | |
name: Test Elixir ${{ matrix.elixir }} / OTP ${{ matrix.otp }} | |
env: | |
MIX_ENV: test | |
MEESEEKS_HTML5EVER_BUILD: "1" | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- elixir: 1.12.0 | |
otp: 23.0 | |
- elixir: 1.13.0 | |
otp: 24.0 | |
- elixir: 1.14.0 | |
otp: 25.0 | |
# TODO change this to ubuntu-latest after OTP 23 is deprecated, see | |
# https://github.com/erlef/setup-beam#compatibility-between-operating-system-and-erlangotp | |
# for compatibility | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Rust | |
uses: dtolnay/rust-toolchain@stable | |
- name: Set up Elixir | |
uses: erlef/setup-beam@v1 | |
with: | |
otp-version: ${{ matrix.otp }} | |
elixir-version: ${{ matrix.elixir }} | |
- name: Retrieve cached Rust dependencies | |
uses: actions/cache@v3 | |
id: cargo-cache | |
with: | |
path: ~/.cargo | |
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-cargo-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }} | |
restore-keys: | | |
${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-cargo- | |
- name: Retrieve cached Elixir dependencies | |
uses: actions/cache@v3 | |
id: mix-cache | |
with: | |
path: deps | |
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }} | |
restore-keys: | | |
${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix- | |
- name: Retrieve cached Elixir build | |
uses: actions/cache@v3 | |
id: build-cache | |
with: | |
path: _build | |
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-build-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-build- | |
- name: Install Elixir dependencies | |
if: steps.mix-cache.outputs.cache-hit != 'true' | |
run: | | |
mix local.rebar --force | |
mix local.hex --force | |
mix deps.get | |
mix deps.compile | |
- name: Compile Elixir | |
run: mix compile | |
- name: Run tests | |
run: mix test |