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
7 changes: 7 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
name: Build and publish Docker image

on:
push:
tags:
- '*.*.*'
release:
types: [published]

jobs:
docker-build-and-publish:
environment:
name: dockerhub

runs-on: ubuntu-latest

permissions:
contents: read
runs-on: ubuntu-latest

steps:
- name: Docker meta
id: meta
Expand All @@ -25,7 +27,7 @@ jobs:
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: Checkout
- name: Checkout code
uses: actions/checkout@v5

- name: Login to Docker Hub
Expand All @@ -46,4 +48,4 @@ jobs:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
tags: ${{ steps.meta.outputs.tags }}
34 changes: 34 additions & 0 deletions .github/workflows/npm-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Build on Pull Request

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

jobs:
npm-build:
runs-on: ubuntu-latest

permissions:
contents: read

strategy:
matrix:
node-version: [24.x]

steps:
- name: Checkout code
uses: actions/checkout@v5

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Run tests
run: npm test
37 changes: 37 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Publish Package to npmjs
on:
release:
types: [published]
jobs:
npm-publish:
environment:
name: npm-bmssp

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [24.x]

permissions:
contents: read
id-token: write

steps:
- name: Checkout code
uses: actions/checkout@v5

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: npm ci

- name: Publish package
run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
24 changes: 0 additions & 24 deletions .github/workflows/npmjs.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -145,4 +145,4 @@ vite.config.ts.timestamp-*
*.swp
*~
.DS_Store
Thumbs.db
Thumbs.db
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ RUN npm install
VOLUME ["src/", "tests/"]

# Default command (can be overridden)
CMD ["node", "tests/main.js"]
CMD ["node", "tests/main.js"]
4 changes: 2 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ <h1>Tsinghua SSSP - BMSSP JS</h1>
Implementation of the Single Source Shortest Path (SSSP) algorithm - Bounded Multiple Source Shortest Paths (BMSSP), originally published by Tsinghua University's research.
</p>
<p>
Read the original paper:
Read the original paper:
<a href="https://dl.acm.org/doi/10.1145/3717823.3718179" target="_blank">
Tsinghua SSSP Paper
</a>
Expand All @@ -93,4 +93,4 @@ <h1>Tsinghua SSSP - BMSSP JS</h1>
<a class="btn" href="https://github.com/sirivasv/tsinghua-sssp" target="_blank">View on GitHub</a>
</div>
</body>
</html></svg>
</html></svg>
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bmssp",
"version": "0.5.0",
"version": "0.6.0",
"description": "Javascript package implementation of the bmssp algorithm.",
"keywords": [
"shortest-paths",
Expand All @@ -24,6 +24,6 @@
"doc": "docs"
},
"scripts": {
"test": "node tests/main.js"
"test": "node test/main.js"
}
}
2 changes: 1 addition & 1 deletion src/bmssp.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ function printMessage(message) {
console.log(message);
}

export { printMessage };
export { printMessage };
2 changes: 1 addition & 1 deletion tests/main.js → test/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ function testFunction() {
}
}

testFunction();
testFunction();