Skip to content
Merged
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
78 changes: 78 additions & 0 deletions .github/workflows/build-and-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
#
# Copyright 2025 Winford (Uncle Grumpy) <winford@object.stream>
#
# SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
#

name: Build and Test

on:
push:
branches: [main]
pull_request:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref != 'refs/heads/main' && github.ref || github.run_id }}
cancel-in-progress: true

jobs:
build-and-test:
runs-on: "ubuntu-24.04"
strategy:
fail-fast: false
matrix:
otp: ["27", "28", "master"]
include:
- otp: "27"
rebar3: "3.25.1"
- otp: "28"
rebar3: "3.26.0"
- otp: "29"
rebar3: "3.27.0"
- otp: "master"
rebar3: "3.27.0"
permissions:
contents: read
steps:

- name: "Setup BEAM"
id: beam-setup
uses: erlef/setup-beam@e6d7c94229049569db56a7ad5a540c051a010af9
with:
otp-version: ${{ matrix.otp }}
rebar3-version: ${{matrix.rebar3}}

- name: "System info"
run: |
echo "**uname:**"
uname -a
echo "**OTP version:**"
cat "$(dirname "$(which erlc)")/../releases/RELEASES" || true

- name: "Checkout repo"
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd

- name: "Restore rebar3 dialyzer and test-coverage cache"
id: test-cover_cache
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306
env:
cache-name: rebar3
with:
path: |
_build
key: ci-${{runner.os}}-${{env.cache-name}}-otp_${{matrix.otp}}-rebar_${{matrix.rebar3}}-${{hashFiles('rebar.config', 'rebar.lock')}}

# Build
- name: "Build escripts"
run: |
rebar3 escriptize

- name: "Build docs"
run: |
rebar3 as doc ex_doc

- name: "Run Tests"
run: |
rebar3 eunit
rebar3 cover
100 changes: 100 additions & 0 deletions .github/workflows/check-formatting.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
#
# Copyright 2025 Winford (Uncle Grumpy) <winford@object.stream>
#
# SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
#

name: "Check Formatting"

on:
workflow_dispatch:
push:
branches: [main]
paths:
- '.github/workflows/**'
- 'rebar.config'
- 'priv/*'
- 'src/**'
- 'include/**'
- 'test/**'
- '**/*.erl'
- '**/*.hrl'
pull_request:
paths:
- '.github/workflows/**'
- 'rebar.config'
- 'priv/*'
- 'src/**'
- 'include/**'
- 'test/**'
- '**/*.erl'
- '**/*.hrl'

Comment thread
coderabbitai[bot] marked this conversation as resolved.
concurrency:
group: ${{ github.workflow }}-${{ github.ref != 'refs/heads/main' && github.ref || github.run_id }}
cancel-in-progress: true

jobs:
format-check:
runs-on: ubuntu-24.04
env:
ERLFMT_VERSION: "v1.7.0"
ACTIONLINT_VERSION: "v1.7.10"
permissions:
contents: read
steps:

- name: "Setup BEAM"
uses: erlef/setup-beam@e6d7c94229049569db56a7ad5a540c051a010af9
id: otp
with:
otp-version: "28"
rebar3-version: "3.26.0"

- name: "Checkout code"
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd

- name: "Cache: restore tools"
id: cache-tools
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306
env:
cache-name: format-checkers
with:
path: |
~/go
~/erlfmt
key: ci-${{runner.os}}-${{env.cache-name}}-${{env.ACTIONLINT_VERSION}}-otp_${{steps.otp.outputs.otp-version}}-rebar3_${{steps.otp.outputs.rebar3-version}}-erlfmt_${{env.ERLFMT_VERSION}}

- name: "Install Actionlint"
if: steps.cache-tools.outputs.cache-hit != 'true'
run: |
cd "${HOME}"
go install "github.com/rhysd/actionlint/cmd/actionlint@${{env.ACTIONLINT_VERSION}}"

- name: "Install erlfmt"
if: steps.cache-tools.outputs.cache-hit != 'true'
run: |
cd "${HOME}"
git clone --depth 1 -b "${ERLFMT_VERSION}" https://github.com/WhatsApp/erlfmt.git
cd erlfmt
rebar3 as release escriptize

- name: "Add tools to PATH"
run: |
echo "${HOME}/go/bin" >> "$GITHUB_PATH"
echo "${HOME}/erlfmt/_build/release/bin" >> "$GITHUB_PATH"

- name: "Check formatting"
run: |
rebar3 fmt --check

- name: "Check workflows"
run: actionlint

- name: "Check markdown"
uses: DavidAnson/markdownlint-cli2-action@ded1f9488f68a970bc66ea5619e13e9b52e601cd
with:
config: '.markdownlint.json'
globs: |
**/*.md
!_build/**
55 changes: 55 additions & 0 deletions .github/workflows/code_quality_check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#
# Copyright 2025 Winford (Uncle Grumpy) <winford@object.stream>
#
# SPDX-License-Identifier: Apache-2.0
#

name: Code Quality Checks

on:
push:
branches: [main]
pull_request:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref != 'refs/heads/main' && github.ref || github.run_id }}
cancel-in-progress: true

jobs:
code-quality:
runs-on: "ubuntu-24.04"
env:
OTP_VERSION: "28"
REBAR3_VERSION: "3.26.0"
permissions:
contents: read
steps:

- name: "Setup BEAM"
uses: erlef/setup-beam@e6d7c94229049569db56a7ad5a540c051a010af9
id: "beam"
with:
otp-version: ${{env.OTP_VERSION}}
rebar3-version: ${{env.REBAR3_VERSION}}

- name: "Checkout repo"
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd

- name: "Restore rebar3 cache (speed up dialyzer)"
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306
env:
cache-name: rebar3
with:
path: |
~/.cache/rebar3
_build
key: ci-${{runner.os}}-${{env.cache-name}}-otp_${{env.OTP_VERSION}}-rebar_${{env.REBAR3_VERSION}}-${{hashFiles('rebar.config')}}

# xref
- name: "Check with xref"
run: rebar3 xref

# dialyzer
- name: "Check with dialyzer"
run: rebar3 dialyzer
75 changes: 75 additions & 0 deletions .github/workflows/publish_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
#
# Copyright 2026 Winford (Uncle Grumpy) <winford@object.stream>
#
# SPDX-License-Identifier: Apache-2.0
#
# This is a workflow for UncleGrumpy/atomvm_spectrometer to publish documentation to GitHub Pages

name: Publish Docs

on:
# Triggers the workflow on pushes to main
push:
branches:
- 'main'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref != 'refs/heads/main' && github.ref || github.run_id }}
cancel-in-progress: true

permissions:
contents: read
pages: write
id-token: write

env:
LANG: C.UTF-8

jobs:

build:
runs-on: ubuntu-24.04
container: erlang:28
steps:

- name: "Checkout code"
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd

- name: "Setup Pages"
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b

- name: "Build Docs"
run: |
rebar3 as doc ex_doc

- name: Upload pages artifact
## Must use v3 for now due to issue actions/deploy-pages#389
uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b
with:
name: github-pages
path: ./doc

deploy:
# Add a dependency to the build job
needs: build

# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

# Specify runner + deployment step
runs-on: ubuntu-24.04
steps:

- name: "Setup Pages"
if: ${{ github.repository == 'UncleGrumpy/atomvm_spectrometer' }}
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b

- name: Deploy to GitHub Pages
if: ${{ github.repository == 'UncleGrumpy/atomvm_spectrometer' }}
id: deployment
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e
27 changes: 27 additions & 0 deletions .github/workflows/reuse-lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# SPDX-FileCopyrightText: 2022 Free Software Foundation Europe e.V. <https://fsfe.org>
#
# SPDX-License-Identifier: CC0-1.0

name: REUSE Compliance Check

on:
push:
branches: [main]
pull_request:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref != 'refs/heads/main' && github.ref || github.run_id }}
cancel-in-progress: true

jobs:
test:
name: "Reuse Compliance"
runs-on: ubuntu-24.04
permissions:
contents: read

steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- name: REUSE Compliance Check
uses: fsfe/reuse-action@676e2d560c9a403aa252096d99fcab3e1132b0f5
28 changes: 17 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
# SPDX-FileCopyrightText: 2026 Winford (Uncle Grumpy) <winford@object.stream>
# SPDX-License-Identifier: CC0-1.0

.rebar3
_build
doc
_checkouts
_vendor
.eunit
*.o
*.beam
*.plt
erl_crash.dump
Comment thread
coderabbitai[bot] marked this conversation as resolved.
.concrete/DEV_MODE

# rebar 2.x
*.swp
*.swo
.erlang.cookie
ebin
log*
.rebar
rel/example_project
ebin/*.beam
deps

# rebar 3
.rebar3
_build/
_checkouts/
rebar3.crashdump
.DS_Store
.vscode/
priv/supported_functions.data.*.bak
5 changes: 5 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"line-length": {
"tables": false
}
}
2 changes: 2 additions & 0 deletions .markdownlint.json.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Copyright 2026 Winford (Uncle Grumpy) <winford@object.stream>
SPDX-License-Identifier: CC0-1.0
Loading
Loading