Skip to content

Commit

Permalink
Added initial files.
Browse files Browse the repository at this point in the history
  • Loading branch information
oubiwann committed Feb 10, 2024
1 parent 3e8ae18 commit 3f1f6e5
Show file tree
Hide file tree
Showing 8 changed files with 247 additions and 27 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: ci/cd

on:
workflow_dispatch:
push:
branches: [ main, 'release/*' ]
pull_request:
branches: [ main, 'release/*' ]
# Build once a month, just to be sure things are still working
schedule:
- cron: "19 3 26 * *"

jobs:

core-builds:
name: Erlang ${{ matrix.otp_version }} build
runs-on: ubuntu-latest

strategy:
matrix:
otp_version: ['24.3', '25.3', '26.1']

steps:
- uses: actions/checkout@v2
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp_version }}
rebar3-version: '3.22'
- name: Compile
run: rebar3 compile
- name: Xref Checks
run: rebar3 xref
- name: Dialyzer
run: rebar3 dialyzer
- name: Proper Tests
run: rebar3 as test do compile, proper --regressions
- name: Run Unit Tests
run: rebar3 as test lfe ltest -tall

older-builds:
name: Old Erlang ${{ matrix.otp_version }} build
runs-on: ubuntu-20.04

strategy:
matrix:
otp_version: ['21.3', '22.3', '23.3']

steps:
- uses: actions/checkout@v2
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp_version }}
rebar3-version: '3.15'
- name: Compile
run: rebar3 compile
- name: Xref Checks
run: rebar3 xref
- name: Dialyzer
run: rebar3 dialyzer
- name: Compile Tests
run: rebar3 as test compile
- name: Proper Tests
run: rebar3 as test proper --regressions
- name: Run Unit Tests
run: rebar3 as test lfe ltest -tall
44 changes: 30 additions & 14 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,33 @@
.eunit
*.o
.DS_Store
*.beam
*.beam
*.elc
*.iml
*.o
*.plt
erl_crash.dump
.concrete/DEV_MODE

# rebar 2.x
.rebar
rel/example_project
ebin/*.beam
deps

# rebar 3
*.sublime-project
*.sublime-workspace
*.swo
*.swp
*~
.\#*
.erlang.cookie
.eunit
.idea
.rebar/*
.rebar3
_build/
_checkouts/
/.emacs.desktop
/.emacs.desktop.lock
\#*\#
_*
_build/*
auto-save-list
bin
deps
ebin
erl_crash.dump
log
logs
rebar/*
rebar3.crashdump
tramp
13 changes: 1 addition & 12 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -175,18 +175,7 @@

END OF TERMS AND CONDITIONS

APPENDIX: How to apply the Apache License to your work.

To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]
Copyright 2024, Duncan McGreggor <oubiwann@gmail.com>.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
64 changes: 63 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,64 @@
# dragon-pubsub
An LFE port of the Elixir/Phoenix PubSub project

[![Build Status][gh-actions-badge]][gh-actions]
[![LFE Versions][lfe-badge]][lfe]
[![Erlang Versions][erlang-badge]][version]
[![Tags][github-tags-badge]][github-tags]

[![Project Logo][logo]][logo-large]

*An LFE library*

##### Table of Contents

* [About](#about-)
* [Build](#build-)
* [Start the Project REPL](#start-the-repl-)
* [Tests](#tests-)
* [Usage](#usage-)
* [License](#license-)

## About [&#x219F;](#table-of-contents)

TBD

## Build [&#x219F;](#table-of-contents)

```shell
$ rebar3 lfe compile
```

# Start the Project REPL [&#x219F;](#table-of-contents)

```shell
$ rebar3 lfe repl
```

# Tests [&#x219F;](#table-of-contents)

```shell
$ rebar3 as test lfe ltest
```

## Usage [&#x219F;](#table-of-contents)

TBD

## License [&#x219F;](#table-of-contents)

Apache License, Version 2.0

Copyright © 2024, Duncan McGreggor <oubiwann@gmail.com>.

[//]: ---Named-Links---

[logo]: https://github.com/lfe-dragon/site/blob/master/priv/images/dragon-logo-2-x250.png
[logo-large]: https://github.com/lfe-dragon/site/blob/master/priv/images/dragon-logo-2-x2400.png
[gh-actions-badge]: https://github.com/lfe-dragon/dragon-pubsub/actions/workflows/cicd.yml/badge.svg
[gh-actions]: https://github.com/lfe-dragon/dragon-pubsub/actions/workflows/cicd.yml
[lfe]: https://github.com/lfe/lfe
[lfe-badge]: https://img.shields.io/badge/lfe-2.1-blue.svg
[erlang-badge]: https://img.shields.io/badge/erlang-21%20to%2026-blue.svg
[version]: https://github.com/lfe-dragon/dragon-pubsub/blob/main/.github/workflows/cicd.yml
[github-tags]: https://github.com/lfe-dragon/dragon-pubsub/tags
[github-tags-badge]: https://img.shields.io/github/tag/lfe-dragon/dragon-pubsub.svg
46 changes: 46 additions & 0 deletions rebar.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{erl_opts, [debug_info]}.

{deps, [
{lfe, "2.1.3"},
{ltest, "0.13.5"}
]}.

{plugins, [
{rebar3_lfe, "0.4.6"}
]}.

{provider_hooks, [
{pre, [{compile, {lfe, compile}}]}
]}.

{xref_checks,[
undefined_function_calls,undefined_functions,locals_not_used,
deprecated_function_calls,deprecated_functions
]}.

{profiles, [
{test, [
{deps, [
{proper, "1.4.0"}
]},
{plugins, [
{rebar3_proper, "0.12.1"}
]},
{eunit_opts, [verbose]},
{erl_opts, [{src_dirs, ["src", "test"]}]}
]}
]}.

{alias, [
{coverage, [
{proper, "-c"},
{cover, "-v --min_coverage=0"}
]},
{check, [
compile,
%%xref,
%%dialyzer,
eunit,
coverage
]}
]}.
10 changes: 10 additions & 0 deletions src/dps.lfe
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
(defmodule dps
(export
(my-fun 0)))

;;; -----------
;;; library API
;;; -----------

(defun my-fun ()
'hello-world)
21 changes: 21 additions & 0 deletions src/dragon-pubsub.app.src
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{application, 'dragon-pubsub', [
{description, "A pubsub definition for the LFE Dragon web framework"},
{vsn, "0.0.0"},
{registered, []},
{applications, [
kernel,
stdlib
]},
{env,[]},
{modules, []},

%% Package metadata:
{pkg_name, dragon_pubsub},
{maintainers, ["Duncan McGreggor"]},
{licenses, ["Apache-2"]},
{links, [
{"GitHub", "https://github.com/lfe-dragon/dragon-pubsub"},
{"Hex", "https://hex.pm/packages/dragon_pubsub"}
]},
{exclude_files, ["priv/*"]}
]}.
11 changes: 11 additions & 0 deletions test/dps-tests.lfe
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
(defmodule dps-tests
(behaviour ltest-unit))

(include-lib "ltest/include/ltest-macros.lfe")

;;; -----------
;;; library API
;;; -----------

(deftest my-fun
(is-equal 'hello-world (dps:my-fun)))

0 comments on commit 3f1f6e5

Please sign in to comment.