Skip to content
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
17 changes: 14 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@

version: 2.1

commands:
check-changed-files-or-halt:
steps:
- run: |
if echo "$(git diff --name-only origin/main HEAD)" | grep -qE '\.github\/.*\.(yaml|yml)$'; then
# if there is a change in the .github folder, halt the build
echo "Stopping build because there is a change in the .github folder"
circleci-agent step halt
fi

jobs:
run-tests:
parallelism: 1
Expand All @@ -21,12 +31,12 @@ jobs:
working_directory: ~/app

steps:
- checkout
- check-changed-files-or-halt
- run: mix local.hex --force
- run: mix local.rebar --force
- run: mix hex.organization auth coverflex_engineering --key $HEX_API_KEY

- checkout

- restore_cache:
keys:
- v1-mix-cache-{{ .Branch }}-{{ checksum "mix.lock" }}
Expand Down Expand Up @@ -61,10 +71,11 @@ jobs:
working_directory: ~/app

steps:
- checkout
- check-changed-files-or-halt
- run: mix local.hex --force
- run: mix local.rebar --force
- run: mix hex.organization auth coverflex_engineering --key $HEX_API_KEY
- checkout
- run: mix do deps.get, deps.compile
- run: HEX_API_KEY=$HEX_API_KEY mix hex.publish package --yes

Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/on_pull_request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: On pull request

on:
workflow_dispatch:
pull_request:
branches:
- main
- hotfix/**
paths-ignore:
- 'infra/**'
- '.github/**'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
run-tests:
uses: coverflex-tech/global-actions/.github/workflows/elixir_run_tests.yaml@main
with:
ELIXIR_VERSION: 1.13.4
OTP_VERSION: 24.3.4
secrets:
CI_PAT: ${{ secrets.CI_PAT }}
OBAN_KEY_FINGERPRINT: ${{ secrets.OBAN_KEY_FINGERPRINT }}
OBAN_LICENSE_KEY: ${{ secrets.OBAN_LICENSE_KEY }}
HEX_API_KEY: ${{ secrets.HEX_API_KEY }}
23 changes: 23 additions & 0 deletions .github/workflows/on_push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: On push main

on:
push:
branches:
- main
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}

jobs:
tag-and-publish:
uses: coverflex-tech/global-actions/.github/workflows/elixir_tag_and_publish.yaml@main
with:
ELIXIR_VERSION: 1.13.4
OTP_VERSION: 24.3.4
secrets:
OBAN_KEY_FINGERPRINT: ${{ secrets.OBAN_KEY_FINGERPRINT }}
OBAN_LICENSE_KEY: ${{ secrets.OBAN_LICENSE_KEY }}
HEX_API_KEY: ${{ secrets.HEX_API_KEY }}
CI_PAT: ${{ secrets.CI_PAT }}