forked from dirs-dev/dirs-rs
-
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.
Preparation for the port from Rust to LFE/Erlang.
- Loading branch information
Showing
16 changed files
with
601 additions
and
590 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,77 @@ | ||
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: Install Deps | ||
run: sudo apt-get update && sudo apt-get install -y gnuplot | ||
- 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 Tests | ||
# run: rebar3 ct -c | ||
- name: Run Unit Tests | ||
run: rebar3 as test lfe ltest -tall | ||
# - name: Test Coverage | ||
# run: rebar3 as test do proper -c, cover -v --min_coverage=0 | ||
|
||
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: Install Deps | ||
run: sudo apt-get update && sudo apt-get install -y gnuplot | ||
- 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 Tests | ||
# run: rebar3 ct -c | ||
- name: Run Unit Tests | ||
run: rebar3 as test lfe ltest -tall | ||
# - name: Test Coverage | ||
# run: rebar3 as test do proper -c, cover -v --min_coverage=0 |
This file was deleted.
Oops, something went wrong.
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,4 +1,35 @@ | ||
Cargo.lock | ||
/target | ||
**/*.rs.bk | ||
.idea | ||
# erlang | ||
.eunit | ||
*.o | ||
*.beam | ||
*.plt | ||
erl_crash.dump | ||
.concrete/DEV_MODE | ||
|
||
# rebar 2.x | ||
.rebar | ||
rel/example_project | ||
ebin/*.beam | ||
deps | ||
|
||
# rebar 3 | ||
.rebar3 | ||
rebar3.crashdump | ||
_build/ | ||
_checkouts/ | ||
rebar.lock | ||
|
||
# emacs | ||
*~ | ||
\#*\# | ||
.\#* | ||
.emacs.desktop | ||
.emacs.desktop.lock | ||
|
||
# apple | ||
.DS_Store | ||
|
||
# misc | ||
/priv/images/drafts/* | ||
/doc/* | ||
/priv/output/* |
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,50 @@ | ||
{erl_opts, [debug_info]}. | ||
|
||
{deps, [ | ||
{lfe, "2.1.2"} | ||
]}. | ||
|
||
{plugins, [ | ||
{rebar3_lfe, "0.4.8"} | ||
]}. | ||
|
||
{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.3.0"}, | ||
{ltest, "0.13.4"} | ||
]}, | ||
{plugins, [ | ||
{rebar3_proper, "0.12.0"} | ||
]}, | ||
{eunit_opts, [verbose]}, | ||
{erl_opts, [{src_dirs, ["src", "test"]}]} | ||
]} | ||
]}. | ||
|
||
{alias, [ | ||
{coverage, [ | ||
{proper, "-c"}, | ||
{cover, "-v --min_coverage=0"} | ||
]}, | ||
%% as test | ||
{ltest, [ | ||
{lfe, ltest, "-tall"} | ||
]}, | ||
{check, [ | ||
compile, | ||
%%xref, | ||
%%dialyzer, | ||
ltest, | ||
coverage | ||
]} | ||
]}. |
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,29 @@ | ||
(defmodule dirs-lin | ||
(export all)) | ||
|
||
;;extern crate dirs_sys; | ||
|
||
;;use std::env; | ||
;;use std::path::PathBuf; | ||
|
||
;;pub fn home_dir() -> Option<PathBuf> { dirs_sys::home_dir() } | ||
|
||
;;pub fn cache_dir() -> Option<PathBuf> { env::var_os("XDG_CACHE_HOME") .and_then(dirs_sys::is_absolute_path).or_else(|| home_dir().map(|h| h.join(".cache"))) } | ||
;;pub fn config_dir() -> Option<PathBuf> { env::var_os("XDG_CONFIG_HOME").and_then(dirs_sys::is_absolute_path).or_else(|| home_dir().map(|h| h.join(".config"))) } | ||
;;pub fn config_local_dir() -> Option<PathBuf> { config_dir() } | ||
;;pub fn data_dir() -> Option<PathBuf> { env::var_os("XDG_DATA_HOME") .and_then(dirs_sys::is_absolute_path).or_else(|| home_dir().map(|h| h.join(".local/share"))) } | ||
;;pub fn data_local_dir() -> Option<PathBuf> { data_dir() } | ||
;;pub fn preference_dir() -> Option<PathBuf> { config_dir() } | ||
;;pub fn runtime_dir() -> Option<PathBuf> { env::var_os("XDG_RUNTIME_DIR").and_then(dirs_sys::is_absolute_path) } | ||
;;pub fn state_dir() -> Option<PathBuf> { env::var_os("XDG_STATE_HOME") .and_then(dirs_sys::is_absolute_path).or_else(|| home_dir().map(|h| h.join(".local/state"))) } | ||
;;pub fn executable_dir() -> Option<PathBuf> { env::var_os("XDG_BIN_HOME") .and_then(dirs_sys::is_absolute_path).or_else(|| home_dir().map(|h| h.join(".local/bin"))) } | ||
|
||
;;pub fn audio_dir() -> Option<PathBuf> { dirs_sys::user_dir("MUSIC") } | ||
;;pub fn desktop_dir() -> Option<PathBuf> { dirs_sys::user_dir("DESKTOP") } | ||
;;pub fn document_dir() -> Option<PathBuf> { dirs_sys::user_dir("DOCUMENTS") } | ||
;;pub fn download_dir() -> Option<PathBuf> { dirs_sys::user_dir("DOWNLOAD") } | ||
;;pub fn font_dir() -> Option<PathBuf> { data_dir().map(|d| d.join("fonts")) } | ||
;;pub fn picture_dir() -> Option<PathBuf> { dirs_sys::user_dir("PICTURES") } | ||
;;pub fn public_dir() -> Option<PathBuf> { dirs_sys::user_dir("PUBLICSHARE") } | ||
;;pub fn template_dir() -> Option<PathBuf> { dirs_sys::user_dir("TEMPLATES") } | ||
;;pub fn video_dir() -> Option<PathBuf> { dirs_sys::user_dir("VIDEOS") } |
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,3 +1,6 @@ | ||
(defmodule dirs-mac | ||
(export all)) | ||
|
||
extern crate dirs_sys; | ||
|
||
use std::path::PathBuf; | ||
|
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,3 +1,6 @@ | ||
(defmodule dirs-win | ||
(export all)) | ||
|
||
extern crate dirs_sys; | ||
|
||
use std::path::PathBuf; | ||
|
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,24 @@ | ||
{application, dirs, [ | ||
{description, "A port of the Rust `dirs` library to LFE/Erlang"}, | ||
{vsn, "0.0.0"}, | ||
{registered, []}, | ||
{mod, {}}, | ||
}, | ||
{applications, [ | ||
kernel, | ||
stdlib | ||
]}, | ||
{env,[]}, | ||
{modules, []}, | ||
|
||
{licenses, ["Apache 2.0"]}, | ||
{links, [ | ||
{"GitHub", "https://github.com/lfex/dirs"}, | ||
{"Hex", "https://hex.pm/packages/dirs"} | ||
]}, | ||
{exclude_files, [ | ||
"priv/html/*", | ||
"priv/images/*", | ||
"priv/.DS_Store" | ||
]} | ||
]}. |
Oops, something went wrong.