-
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.
- Loading branch information
Showing
8 changed files
with
242 additions
and
30 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* @travelping/erlang-devs |
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,25 @@ | ||
name: publish to hex.pm | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-22.04 | ||
container: | ||
image: erlang:27.1-alpine | ||
steps: | ||
- name: Prepare | ||
run: | | ||
apk update | ||
apk --no-cache upgrade | ||
apk --no-cache add git | ||
- uses: actions/checkout@v4 | ||
- name: Publish to Hex.pm | ||
env: | ||
HEX_API_KEY: ${{ secrets.HEX_API_KEY }} | ||
run: | | ||
rebar3 ex_edoc | ||
rebar3 hex publish -r hexpm --yes |
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,98 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
pull_request: | ||
branches: [ $default-branch ] | ||
release: | ||
types: | ||
- created | ||
|
||
jobs: | ||
test: | ||
name: CI | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
otp: [27.0, 27.1] | ||
container: | ||
image: erlang:${{ matrix.otp }}-alpine | ||
options: --privileged | ||
steps: | ||
- | ||
name: Prepare | ||
run: | | ||
apk update | ||
apk --no-cache upgrade | ||
apk --no-cache add docker git zstd iproute2 iproute2-ss | ||
- | ||
name: git special configs | ||
run: | | ||
git config --global --add safe.directory /__w/enats/enats | ||
- | ||
name: Check out repository | ||
uses: actions/checkout@v4 | ||
- | ||
name: Build | ||
run: rebar3 compile | ||
- | ||
name: Run tests | ||
run: | | ||
docker run -d --rm --publish 172.18.0.1:4222:4222/tcp nats:latest -js | ||
rebar3 xref | ||
rebar3 dialyzer | ||
rebar3 ct --config priv/ct-github.config | ||
- | ||
name: Tar Test Output | ||
if: ${{ always() }} | ||
run: tar -cf - _build/test/logs/ | zstd -15 -o ct-logs-${{ matrix.otp }}.tar.zst | ||
- | ||
name: Archive Test Output | ||
if: ${{ always() }} | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: test-output-${{ matrix.otp }} | ||
path: | | ||
ct-logs-${{ matrix.otp }}.tar.zst | ||
_build/test/logs/*/junit_report.xml | ||
publish-test-results: | ||
name: "Publish Tests Results" | ||
needs: test | ||
runs-on: ubuntu-latest | ||
permissions: | ||
checks: write | ||
pull-requests: write | ||
contents: read | ||
issues: read | ||
if: always() | ||
steps: | ||
- | ||
name: Download Artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
path: artifacts | ||
- | ||
name: Publish Test Results | ||
uses: EnricoMi/publish-unit-test-result-action@v2 | ||
with: | ||
files: "artifacts/**/junit_report.xml" | ||
|
||
slack: | ||
needs: test | ||
runs-on: ubuntu-22.04 | ||
if: always() | ||
steps: | ||
- | ||
name: Slack notification | ||
uses: 8398a7/action-slack@v3 | ||
with: | ||
author_name: "GitHub Actions" | ||
username: ${{ github.event.repository.name }} | ||
icon_emoji: ':octocat:' | ||
fields: repo, message, ref, commit, author, action, eventName, workflow, job, took | ||
status: ${{ needs.test.result }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} | ||
MATRIX_CONTEXT: ${{ toJson(matrix) }} |
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,39 @@ | ||
name: review | ||
|
||
on: | ||
pull_request_target: | ||
types: | ||
- opened | ||
- synchronize | ||
branches: | ||
- main | ||
- 'stable/**' | ||
- 'feature/**' | ||
|
||
jobs: | ||
code-style-review: | ||
runs-on: ubuntu-22.04 | ||
container: erlang:27.1-alpine | ||
env: | ||
ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
steps: | ||
- | ||
name: install dependencies | ||
run: | | ||
apk --no-cache -u add git emacs-nox | ||
- | ||
name: Check out repository | ||
uses: actions/checkout@v4 | ||
- | ||
name: format | ||
run: rebar3 fmt | ||
- | ||
name: automated review | ||
uses: googleapis/code-suggester@v4 | ||
with: | ||
command: review | ||
pull_number: ${{ github.event.pull_request.number }} | ||
git_dir: '.' | ||
- | ||
name: check | ||
run: git diff --quiet --exit-code |
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 @@ | ||
{nats_host, ~"172.18.0.1"}. |
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
Oops, something went wrong.