Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
1bcc5b9
remove old code
lucasmenendez Feb 11, 2025
81c8a03
new primitives for new implementation with tests: app, expiration and id
lucasmenendez Feb 11, 2025
1ec6447
dependencies updated
lucasmenendez Feb 11, 2025
2871a85
workflow for testing on github actions
lucasmenendez Feb 11, 2025
aa2f41e
old test fixed
lucasmenendez Feb 11, 2025
7ff6911
token and verify token methods
lucasmenendez Feb 12, 2025
b66553c
include hedged nonce during sign generation
lucasmenendez Feb 17, 2025
003d0fb
remove old code
lucasmenendez Feb 20, 2025
810e45d
some internal stuff like custom error class and fake smtp server for …
lucasmenendez Feb 20, 2025
b21a917
new email package with tests and new templates definitions which supp…
lucasmenendez Feb 20, 2025
c65f8ce
update main with new changes and new workflow step to show the test c…
lucasmenendez Feb 20, 2025
5fd5ae5
race fixed
lucasmenendez Feb 20, 2025
aaf1ca2
fix workflow
lucasmenendez Feb 20, 2025
cbab2f7
new notifications and mail templates, including login mail template
lucasmenendez Mar 2, 2025
68b0ec5
new token package with new structs to better data managment, includin…
lucasmenendez Mar 2, 2025
212fa88
full api implementation with basic features, includes requests, respo…
lucasmenendez Mar 2, 2025
2514b8c
update workflow
lucasmenendez Mar 2, 2025
7d30e7e
fixing tests
lucasmenendez Mar 2, 2025
1262250
token comments and new tests
lucasmenendez Mar 8, 2025
c7b2f4f
new api test and minor changes
lucasmenendez Mar 8, 2025
256d4ee
dependencies updated, handlers tests
lucasmenendez Mar 8, 2025
af95dad
more api tests
lucasmenendez Mar 8, 2025
6daa958
more notification tests
lucasmenendez Mar 8, 2025
25c3156
demo cmd
lucasmenendez Mar 30, 2025
5797f0a
increase ratelimits and new makefile
lucasmenendez Mar 30, 2025
b571e3c
remove prefix from env vars
lucasmenendez Mar 30, 2025
c9471d4
remove rate limiter for deploy debug
lucasmenendez Mar 30, 2025
ee8abb2
more integration of app secret
lucasmenendez Mar 30, 2025
7febd69
Create LICENSE
lucasmenendez Apr 6, 2025
1dd1eda
make file and docker file for production
lucasmenendez Apr 6, 2025
ef0c2d2
new tests and fakesmtpserver moved to its own package
lucasmenendez Apr 9, 2025
d3f94c0
first README
lucasmenendez Apr 15, 2025
306a259
new api/io package with more tests
lucasmenendez Apr 15, 2025
c87b918
issues with osflag fixed, more comments and tests
lucasmenendez Apr 16, 2025
8d0ef8e
example.env updated
lucasmenendez Apr 16, 2025
3b44b2c
remove ratelimiter, does not work
lucasmenendez Apr 16, 2025
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
55 changes: 55 additions & 0 deletions .github/parse-coverage-report.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
const readline = require("readline");

const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
terminal: false,
});

const summary = { fail: [], pass: [], skip: [] };

rl.on("line", (line) => {
const output = JSON.parse(line);
if (
output.Action === "pass" ||
output.Action === "skip" ||
output.Action === "fail"
) {
if (output.Test) {
summary[output.Action].push(output);
}
}
});

function totalTime(entries) {
return entries.reduce((total, l) => total + l.Elapsed, 0);
}

rl.on("close", () => {
console.log("## 📋 Tests executed");
console.log("| | Number of Tests | Total Time |");
console.log("|--|--|--|");
console.log(
"| ✅ Passed | %d | %fs |",
summary.pass.length,
totalTime(summary.pass)
);
console.log(
"| ❌ Failed | %d | %fs |",
summary.fail.length,
totalTime(summary.fail)
);
console.log(
"| 🔜 Skipped | %d | %fs |",
summary.skip.length,
totalTime(summary.skip)
);

if (summary.fail.length > 0) {
console.log("\n## Failures\n");
}

summary.fail.forEach((test) => {
console.log("* %s (%s) %fs", test.Test, test.Package, test.Elapsed);
});
});
75 changes: 75 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Build and Test

on:
push:
branches:
- main
pull_request:

jobs:
job_go_checks:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Set up Go environment
uses: actions/setup-go@v5
with:
go-version: "1.24"
- name: Tidy go module
run: |
go mod tidy
if [[ $(git status --porcelain) ]]; then
git diff
echo
echo "go mod tidy made these changes, please run 'go mod tidy' and include those changes in a commit"
exit 1
fi
- name: Run gofumpt
run: diff -u <(echo -n) <(go run mvdan.cc/gofumpt@@latest -d .)
- name: Run go vet
run: go vet ./...

job_go_test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Set up Go environment
uses: actions/setup-go@v5
with:
go-version: "1.24"
- name: Run Go test -race
run: go test ./... -v -race -timeout=1h
- name: Rerun Go test to generate coverage report
run: |
go test -v -timeout 15m -coverprofile=./cover.out -json ./... > tests.log
- name: Convert report to html
run: go tool cover -html=cover.out -o cover.html
- name: Print coverage report
run: |
set -o pipefail && cat tests.log | node .github/parse-coverage-report.js >> $GITHUB_STEP_SUMMARY
echo $GITHUB_STEP_SUMMARY
- name: Print coverage report
run: |
go tool cover -func=cover.out > ./cover.txt
echo "<details><summary>📏 Tests coverage</summary>" >> $GITHUB_STEP_SUMMARY
echo -e "\n\`\`\`" >> $GITHUB_STEP_SUMMARY
cat ./cover.txt >> $GITHUB_STEP_SUMMARY
echo -e "\`\`\`\n</details>" >> $GITHUB_STEP_SUMMARY
- name: Store coverage report
uses: actions/upload-artifact@v4
with:
name: report
path: |
tests.log
cover.txt
cover.out
cover.html
Loading