forked from Nebo15/logger_json
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: sync files with stordco/common-config-elixir
- Loading branch information
1 parent
23ad7fc
commit 2abec6e
Showing
10 changed files
with
245 additions
and
42 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
## Checklist | ||
|
||
<!-- | ||
For each bullet, ensure your pr meets the criteria and write a note explaining how this PR relates. Mark them as complete as they are done. All top-level checkboxes should be checked regardless of their relevance to the pr with a note explaining whether they are relevant or not. | ||
--> | ||
|
||
- [ ] Code conforms to the [Elixir Styleguide](https://github.com/christopheradams/elixir_style_guide) | ||
|
||
## Problem | ||
|
||
<!-- | ||
What is the problem you're solving or feature you're implementing? Link to any Jira tickets or previous discussions of the issue. | ||
--> | ||
|
||
## Details | ||
|
||
<!-- | ||
Include a brief overview of the technical process you took (or are going to take!) to get from the problem to the solution. | ||
--> |
File renamed without changes.
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,120 +1,211 @@ | ||
# This file is synced with stordco/common-config-elixir. Any changes will be overwritten. | ||
|
||
name: CI | ||
|
||
on: | ||
merge_group: | ||
pull_request: | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize | ||
merge_group: | ||
push: | ||
branches: | ||
- main | ||
- code-freeze/** | ||
workflow_call: | ||
secrets: | ||
CI_SERVICE_KEY: | ||
required: true | ||
GH_PERSONAL_ACCESS_TOKEN: | ||
required: true | ||
HEX_API_KEY: | ||
required: true | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
Changed: | ||
name: Changed Files | ||
runs-on: ubuntu-latest | ||
|
||
outputs: | ||
database: ${{ steps.changed.outputs.database_any_changed }} | ||
docker: ${{ steps.changed.outputs.docker_any_changed }} | ||
elixir: ${{ steps.changed.outputs.elixir_any_changed }} | ||
helm: ${{ steps.changed.outputs.helm_any_changed }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 2 | ||
|
||
- id: changed | ||
name: Get Changed Files | ||
uses: tj-actions/changed-files@v43 | ||
with: | ||
files_yaml: | | ||
database: | ||
- '.github/workflows/ci.yaml' | ||
- 'priv/*repo/**' | ||
docker: | ||
- '.github/workflows/ci.yaml' | ||
- 'Dockerfile' | ||
elixir: | ||
- '.github/workflows/ci.yaml' | ||
- 'priv/**' | ||
- '**.ex' | ||
- '**.exs' | ||
- '**.heex' | ||
helm: | ||
- '.github/workflows/ci.yaml' | ||
- '.github/workflows/staging.yaml' | ||
- '.github/workflows/production.yaml' | ||
- 'helm/**' | ||
Credo: | ||
if: ${{ !startsWith(github.head_ref, 'release-please--branches') && needs.Changed.outputs.elixir == 'true' }} | ||
needs: [Changed] | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Elixir | ||
uses: stordco/actions-elixir/setup@v1 | ||
with: | ||
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} | ||
hex-token: ${{ secrets.HEX_API_KEY }} | ||
oban-fingerprint: ${{ secrets.OBAN_KEY_FINGERPRINT }} | ||
oban-token: ${{ secrets.OBAN_LICENSE_KEY }} | ||
|
||
- name: Credo | ||
run: mix credo | ||
run: mix credo --strict | ||
|
||
Deps: | ||
Dependencies: | ||
if: ${{ !startsWith(github.head_ref, 'release-please--branches') && needs.Changed.outputs.elixir == 'true' }} | ||
needs: [Changed] | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Elixir | ||
uses: stordco/actions-elixir/setup@v1 | ||
with: | ||
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} | ||
hex-token: ${{ secrets.HEX_API_KEY }} | ||
oban-fingerprint: ${{ secrets.OBAN_KEY_FINGERPRINT }} | ||
oban-token: ${{ secrets.OBAN_LICENSE_KEY }} | ||
|
||
- name: Unused | ||
run: mix deps.unlock --check-unused | ||
|
||
Dialyzer: | ||
if: ${{ !startsWith(github.head_ref, 'release-please--branches') && needs.Changed.outputs.elixir == 'true' }} | ||
needs: [Changed] | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Elixir | ||
uses: stordco/actions-elixir/setup@v1 | ||
with: | ||
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} | ||
hex-token: ${{ secrets.HEX_API_KEY }} | ||
oban-fingerprint: ${{ secrets.OBAN_KEY_FINGERPRINT }} | ||
oban-token: ${{ secrets.OBAN_LICENSE_KEY }} | ||
|
||
- name: Dialyzer | ||
run: mix dialyzer --format github | ||
|
||
Docs: | ||
Documentation: | ||
if: ${{ !startsWith(github.head_ref, 'release-please--branches') && needs.Changed.outputs.elixir == 'true' }} | ||
needs: [Changed] | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Elixir | ||
uses: stordco/actions-elixir/setup@v1 | ||
with: | ||
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} | ||
hex-token: ${{ secrets.HEX_API_KEY }} | ||
oban-fingerprint: ${{ secrets.OBAN_KEY_FINGERPRINT }} | ||
oban-token: ${{ secrets.OBAN_LICENSE_KEY }} | ||
|
||
- name: Docs | ||
run: mix docs | ||
|
||
Format: | ||
if: ${{ !startsWith(github.head_ref, 'release-please--branches') && needs.Changed.outputs.elixir == 'true' }} | ||
needs: [Changed] | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Elixir | ||
uses: stordco/actions-elixir/setup@v1 | ||
with: | ||
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} | ||
hex-token: ${{ secrets.HEX_API_KEY }} | ||
oban-fingerprint: ${{ secrets.OBAN_KEY_FINGERPRINT }} | ||
oban-token: ${{ secrets.OBAN_LICENSE_KEY }} | ||
|
||
- name: Format | ||
run: mix format --check-formatted | ||
|
||
Test: | ||
name: Test (Elixir ${{ matrix.versions.elixir }} OTP ${{ matrix.versions.otp }}) | ||
|
||
runs-on: ubuntu-latest | ||
|
||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
MIX_ENV: test | ||
|
||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Elixir | ||
uses: stordco/actions-elixir/setup@v1 | ||
with: | ||
elixir-version: ${{ matrix.versions.elixir }} | ||
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} | ||
hex-token: ${{ secrets.HEX_API_KEY }} | ||
oban-fingerprint: ${{ secrets.OBAN_KEY_FINGERPRINT }} | ||
oban-token: ${{ secrets.OBAN_LICENSE_KEY }} | ||
otp-version: ${{ matrix.versions.otp }} | ||
|
||
- name: Compile | ||
run: mix compile --warnings-as-errors | ||
|
||
- name: Test | ||
run: mix test | ||
run: mix coveralls.github | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
versions: | ||
- elixir: 1.13 | ||
otp: 25 | ||
- elixir: 1.14 | ||
otp: 25 | ||
- elixir: 1.15 | ||
otp: 26 | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,24 +12,38 @@ on: | |
- synchronize | ||
|
||
jobs: | ||
title: | ||
if: github.event_name == 'pull_request' | ||
name: Check Title | ||
Title: | ||
if: ${{ github.event_name == 'pull_request' }} | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Check | ||
uses: stordco/actions[email protected] | ||
uses: actions/github-script@v7 | ||
with: | ||
regex: '^(feat!|fix!|fix|feat|chore|(fix|feat|chore)\(\w.*\)):\s(\[\w{1,8}-\d{1,8}\]|.*).*' | ||
hint: | | ||
You can pass the following formats: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
script: | | ||
const title = context.payload?.pull_request?.title; | ||
if (typeof title !== 'string') { | ||
core.info("Pull request data not in payload. Skipping PR title check."); | ||
return; | ||
} | ||
const REGEX = /^(feat!|fix!|fix|feat|chore|(fix|feat|chore)\(\w.*\)):\s(\[\w{1,8}-\d{1,8}\]|.*).*/; | ||
if (!REGEX.test(title)) { | ||
core.setFailed("Pull request title does not follow conventional commits"); | ||
console.log(` | ||
Pull Request title "${title}" does not follow our [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) naming scheme. | ||
Please try renaming the PR to match one of these examples: | ||
fix: [OR-123] some title of the PR | ||
feat: [OR-1234] some title of the PR | ||
chore: update some action | ||
chore: a small insignificant change | ||
fix: [JIRA-1234] fix an existing feature | ||
feat: [JIRA-1234] a new feature to release | ||
feat!: a breaking change | ||
Note: Adding ! (i.e. `feat!:`) represents a breaking change and will result in a SemVer major. | ||
Note: Adding ! (i.e. \`feat!:\`) represents a breaking change and will result in a SemVer major release. | ||
`.trim()); | ||
} |
Oops, something went wrong.