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

improve ci #157

Merged
merged 5 commits into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
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
26 changes: 21 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"]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now we are using latest table ClickHouse for tests by default.

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"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But we keep Plausible-specific versions too.

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,12 @@ 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: "latest"
- run: mix format --check-formatted
Loading