Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump apps version in GitHub CI #166

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 32 additions & 18 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ on:

jobs:
test:
name: Elixir ${{matrix.elixir}} / OTP ${{matrix.otp}}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

We want to show the lint flag in job name.

runs-on: ubuntu-latest
runs-on: ubuntu-20.04

services:
postgres:
Expand All @@ -21,34 +20,37 @@ jobs:
POSTGRES_PASSWORD: postgres

strategy:
fail-fast: false
matrix:
elixir:
- '1.13'
- '1.14'
otp:
- '24'
- '25'
include:
- pair:
elixir: 1.11.4
otp: 22.3
- pair:
elixir: 1.15.7
otp: 26.1
lint: lint

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: ${{ matrix.elixir }}
otp-version: ${{ matrix.otp }}
elixir-version: ${{ matrix.pair.elixir }}
otp-version: ${{ matrix.pair.otp }}

- name: Restore deps cache
uses: actions/cache@v3
with:
path: |
deps
_build
key: deps-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}-git-${{ github.sha }}
key: deps-${{ runner.os }}-${{ matrix.pair.otp }}-${{ matrix.pair.elixir }}-${{ hashFiles('**/mix.lock') }}-git-${{ github.sha }}
restore-keys: |
deps-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}
deps-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}
deps-${{ runner.os }}-${{ matrix.pair.otp }}-${{ matrix.pair.elixir }}-${{ hashFiles('**/mix.lock') }}
deps-${{ runner.os }}-${{ matrix.pair.otp }}-${{ matrix.pair.elixir }}

- name: Create dializer plts path
run: mkdir -p priv/plts
Expand All @@ -57,21 +59,32 @@ jobs:
uses: actions/cache@v3
with:
path: priv/plts
key: plts-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}-${{ github.sha }}
key: plts-${{ runner.os }}-${{ matrix.pair.otp }}-${{ matrix.pair.elixir }}-${{ hashFiles('**/mix.lock') }}-${{ github.sha }}
restore-keys: |
plts-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}
plts-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}
plts-${{ runner.os }}-${{ matrix.pair.otp }}-${{ matrix.pair.elixir }}-${{ hashFiles('**/mix.lock') }}
plts-${{ runner.os }}-${{ matrix.pair.otp }}-${{ matrix.pair.elixir }}

- name: Install package dependencies
run: mix deps.get

- name: Check code format
run: mix format --check-formatted
if: ${{ matrix.lint }}

- name: Check unused deps
run: mix deps.unlock --check-unused
if: ${{ matrix.lint }}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Run mix deps.unlock --check-unused
** (Mix) Unused dependencies in mix.lock file:

  * :connection

Error: Process completed with exit code 1.


- name: Compile dependencies
run: mix compile
run: mix deps.compile
env:
MIX_ENV: test

- name: Compile app
run: mix compile --warnings-as-errors
env:
MIX_ENV: test
if: ${{ matrix.lint }}

- name: Run unit tests
run: |
Expand All @@ -82,3 +95,4 @@ jobs:

- name: Run dialyzer
run: mix dialyzer
if: ${{ matrix.lint }}
4 changes: 2 additions & 2 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
elixir 1.14.1-otp-24 1.12.0-otp-24
erlang 24.1.7 24.1.5 24.1.2 24.1.1 24.0
elixir 1.15.7-otp-26
erlang 26.1.2
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Make sure the tests pass.

Running tests for Dataloader requires a running instance of Postgres. The easiest way to do this is to run Postgres inside of Docker whilst running the Dataloader tests. In one terminal run:

docker run -p 5432:5432 -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=dataloader_test postgres
docker run -p 5432:5432 -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=dataloader_test docker.io/postgres
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$ docker run -p 5432:5432 -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=dataloader_test postgres
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
Error: short-name "postgres" did not resolve to an alias and no unqualified-search registries are defined in "/etc/containers/registries.conf"


and in another terminal run:

Expand Down
4 changes: 2 additions & 2 deletions lib/dataloader.ex
Original file line number Diff line number Diff line change
Expand Up @@ -394,13 +394,13 @@ defmodule Dataloader do
# Optionally use `async/1` and `async_stream/3` functions from
# `opentelemetry_process_propagator` if available
if Code.ensure_loaded?(OpentelemetryProcessPropagator.Task) do
@spec async((() -> any)) :: Task.t()
@spec async((-> any)) :: Task.t()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Run mix format --check-formatted
** (Mix) mix format failed due to --check-formatted.
The following files are not formatted:

/home/runner/work/dataloader/dataloader/lib/dataloader.ex

defdelegate async(fun), to: OpentelemetryProcessPropagator.Task

@spec async_stream(Enumerable.t(), (term -> term), keyword) :: Enumerable.t()
defdelegate async_stream(items, fun, opts), to: OpentelemetryProcessPropagator.Task
else
@spec async((() -> any)) :: Task.t()
@spec async((-> any)) :: Task.t()
defdelegate async(fun), to: Task

@spec async_stream(Enumerable.t(), (term -> term), keyword) :: Enumerable.t()
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ defmodule Dataloader.Mixfile do
[
app: :dataloader,
version: @version,
elixir: "~> 1.12",
elixir: "~> 1.11",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now, the minimum supported Elixir version with security patches is 1.11, see https://hexdocs.pm/elixir/1.15.7/compatibility-and-deprecations.html

start_permanent: Mix.env() == :prod,
elixirc_paths: elixirc_paths(Mix.env()),
package: package(),
Expand Down
1 change: 0 additions & 1 deletion mix.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
%{
"connection": {:hex, :connection, "1.1.0", "ff2a49c4b75b6fb3e674bfc5536451607270aac754ffd1bdfe175abe4a6d7a68", [:mix], [], "hexpm", "722c1eb0a418fbe91ba7bd59a47e28008a189d47e37e0e7bb85585a016b2869c"},
"db_connection": {:hex, :db_connection, "2.5.0", "bb6d4f30d35ded97b29fe80d8bd6f928a1912ca1ff110831edcd238a1973652c", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "c92d5ba26cd69ead1ff7582dbb860adeedfff39774105a4f1c92cbb654b55aa2"},
"decimal": {:hex, :decimal, "2.1.1", "5611dca5d4b2c3dd497dec8f68751f1f1a54755e8ed2a966c2633cf885973ad6", [:mix], [], "hexpm", "53cfe5f497ed0e7771ae1a475575603d77425099ba5faef9394932b35020ffcc"},
"dialyxir": {:hex, :dialyxir, "1.3.0", "fd1672f0922b7648ff9ce7b1b26fcf0ef56dda964a459892ad15f6b4410b5284", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "00b2a4bcd6aa8db9dcb0b38c1225b7277dca9bc370b6438715667071a304696f"},
Expand Down
Loading