Skip to content

CI

CI #397

Workflow file for this run

---
name: CI
"on":
push:
branches:
- main
pull_request:
branches:
- "*"
workflow_dispatch: {}
merge_group:
schedule:
- cron: 0 18 * * *
concurrency:
group: ${{github.workflow}}-${{github.ref}}
cancel-in-progress: true
jobs:
ci:
name: CI
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: erlef/setup-beam@5304e04ea2b355f03681464e683d92e3b2f18451 # v1.18.2
id: setup-beam
with:
version-type: strict
version-file: .tool-versions
- name: Restore rebar3's cache
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: ~/.cache/rebar3
key: "rebar3-cache-for\
-os-${{runner.os}}\
-otp-${{steps.setup-beam.outputs.otp-version}}\
-rebar3-${{steps.setup-beam.outputs.rebar3-version}}"
- name: Continuous Integration
run: |
rebar3 as test ci
npm run format-lint
- name: Test release
run: |
rebar3 release
_build/default/rel/arizona_example/bin/arizona_example daemon
curl -f -v http://127.0.0.1:8080
npm run test
_build/default/rel/arizona_example/bin/arizona_example stop
- name: Check if build left artifacts
run: git diff --exit-code
- name: Notify on failed build
uses: jayqi/failed-build-issue-action@1a893bbf43ef1c2a8705e2b115cd4f0fe3c5649b # v1.2.0
if: failure() && github.event.pull_request == null
id: failed-build
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Maybe close failure notification
if: github.event.pull_request == null
run: |
if [[ -z "${{steps.failed-build.outputs.issue-number}}" ]];then
build_failed=$(\
gh search issues\
--label "build failed"\
--json "number"\
--jq ".[0].number"\
--repo "${{github.repository}}"\
)
if [[ "${build_failed}" != "null" ]]; then
gh issue close "${build_failed}"
fi
fi
env:
GH_TOKEN: ${{ github.token }}