Skip to content

Commit

Permalink
improve ci
Browse files Browse the repository at this point in the history
  • Loading branch information
ruslandoga committed Jan 29, 2024
1 parent 6cf4e53 commit 594c929
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 13 deletions.
21 changes: 13 additions & 8 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,21 @@ name: bench
on: workflow_dispatch

jobs:
mix:
benchee:
runs-on: ubuntu-latest

env:
MIX_ENV: bench

strategy:
matrix:
elixir: ["1.16"]
otp: ["26"]
clickhouse: ["latest"]

services:
clickhouse:
image: clickhouse/clickhouse-server:23.3.7.5-alpine
image: clickhouse/clickhouse-server:${{ matrix.clickhouse }}
ports:
- 8123:8123
env:
Expand All @@ -26,21 +32,20 @@ jobs:

- uses: erlef/setup-beam@v1
with:
elixir-version: "1.16"
otp-version: "26"
elixir-version: ${{ matrix.elixir }}
otp-version: ${{ matrix.otp }}

- uses: actions/cache@v3
with:
path: |
deps
_build
key: bench-ref-${{ github.head_ref || github.ref }}-mix-${{ hashFiles('**/mix.lock') }}
key: bench-${{ matrix.otp }}-${{ matrix.elixir }}-${{ github.head_ref || github.ref }}-${{ hashFiles('**/mix.lock') }}
restore-keys: |
bench-ref-${{ github.head_ref || github.ref }}-mix-
bench-ref-refs/heads/master-mix-
bench-${{ matrix.otp }}-${{ matrix.elixir }}-${{ github.head_ref || github.ref }}-
bench-${{ matrix.otp }}-${{ matrix.elixir }}-refs/heads/master-
- run: mix deps.get --only $MIX_ENV
- run: mix format --check-formatted
- run: mix compile --warnings-as-errors
- run: mkdir results
- run: mix run bench/insert.exs | tee results/insert.txt
Expand Down
28 changes: 23 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: test
name: mix

on:
pull_request:
push:
branches: [master]

jobs:
mix:
test:
runs-on: ubuntu-latest

env:
Expand All @@ -16,17 +16,24 @@ jobs:
matrix:
elixir: ["1.14", "1.15", "1.16"]
otp: ["25", "26"]
clickhouse: ["23.3.7.5"]
clickhouse: ["latest"]
timezone: ["UTC"]
include:
- elixir: "1.16"
otp: "26"
clickhouse: "23.3.7.5"
clickhouse: "latest"
timezone: "Europe/Berlin"
# Plausible
# - https://github.com/plausible/analytics/blob/master/.tool-versions
# - https://github.com/plausible/analytics/blob/master/.github/workflows/elixir.yml
- elixir: "1.16.0"
otp: "26.2.1"
clickhouse: "23.3.7.5"
timezone: "UTC"

services:
clickhouse:
image: clickhouse/clickhouse-server:${{ matrix.clickhouse }}-alpine
image: clickhouse/clickhouse-server:${{ matrix.clickhouse }}
ports:
- 8123:8123
env:
Expand Down Expand Up @@ -59,3 +66,14 @@ jobs:
- run: mix format --check-formatted
- run: mix compile --warnings-as-errors
- run: mix test --include slow

format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
with:
elixir-version: "1"
otp-version: "26"
- run: elixir -v
- run: mix format --check-formatted

0 comments on commit 594c929

Please sign in to comment.