Skip to content

Commit b9fd20d

Browse files
save
1 parent ed201c4 commit b9fd20d

File tree

5 files changed

+36
-34
lines changed

5 files changed

+36
-34
lines changed

.github/workflows/osrm-backend.yml

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -525,34 +525,34 @@ jobs:
525525
uses: actions/setup-node@v3
526526
with:
527527
node-version: ${{ matrix.node }}
528-
# - name: Enable Node.js cache
529-
# uses: actions/cache@v2
530-
# with:
531-
# path: ~/.npm
532-
# key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
533-
# restore-keys: |
534-
# ${{ runner.os }}-node-
535-
# - name: Enable compiler cache
536-
# uses: actions/cache@v2
537-
# with:
538-
# path: ~/.ccache
539-
# key: ccache-${{ matrix.name }}-${{ github.sha }}
540-
# restore-keys: |
541-
# ccache-${{ matrix.name }}-
542-
# - name: Enable Conan cache
543-
# uses: actions/cache@v2
544-
# with:
545-
# path: ~/.conan
546-
# key: v6-conan-${{ matrix.name }}-${{ github.sha }}
547-
# restore-keys: |
548-
# v6-conan-${{ matrix.name }}-
549-
# - name: Enable test cache
550-
# uses: actions/cache@v2
551-
# with:
552-
# path: ${{github.workspace}}/test/cache
553-
# key: v3-test-${{ matrix.name }}-${{ github.sha }}
554-
# restore-keys: |
555-
# v3-test-${{ matrix.name }}-
528+
- name: Enable Node.js cache
529+
uses: actions/cache@v2
530+
with:
531+
path: ~/.npm
532+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
533+
restore-keys: |
534+
${{ runner.os }}-node-
535+
- name: Enable compiler cache
536+
uses: actions/cache@v2
537+
with:
538+
path: ~/.ccache
539+
key: ccache-${{ matrix.name }}-${{ github.sha }}
540+
restore-keys: |
541+
ccache-${{ matrix.name }}-
542+
- name: Enable Conan cache
543+
uses: actions/cache@v2
544+
with:
545+
path: ~/.conan
546+
key: v6-conan-${{ matrix.name }}-${{ github.sha }}
547+
restore-keys: |
548+
v6-conan-${{ matrix.name }}-
549+
- name: Enable test cache
550+
uses: actions/cache@v2
551+
with:
552+
path: ${{github.workspace}}/test/cache
553+
key: v3-test-${{ matrix.name }}-${{ github.sha }}
554+
restore-keys: |
555+
v3-test-${{ matrix.name }}-
556556
557557
- name: Prepare environment
558558
run: |
@@ -675,6 +675,7 @@ jobs:
675675
cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE}
676676
make --jobs=${JOBS}
677677
popd
678+
- run: npm link
678679
- run: osrm-routed-js --version
679680
- name: Run all tests
680681
if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY != 'ON' && matrix.ENABLE_APPLE_SILICON != 'ON' }}

routed-js/OSRMWrapper.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
33
return (mod && mod.__esModule) ? mod : { "default": mod };
44
};
55
Object.defineProperty(exports, "__esModule", { value: true });
6-
exports.OSRMWrapper = void 0;
6+
exports.OSRMWrapper = exports.version = void 0;
77
const util_1 = __importDefault(require("util"));
88
const OSRM = require('../lib/index.js');
9+
exports.version = OSRM.version;
910
class OSRMWrapper {
1011
constructor(osrmOptions) {
1112
this.osrm = new OSRM(osrmOptions);

routed-js/OSRMWrapper.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import util from 'util';
22
const OSRM = require('../lib/index.js');
33

4+
export const version = OSRM.version;
5+
46
export class OSRMWrapper {
57
private readonly osrm: typeof OSRM;
68

routed-js/routed.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ async function main() {
3636
.strict()
3737
.argv;
3838
if (argv.version) {
39-
// TODO: print real version
40-
process.stdout.write('v5.27.0\n');
39+
process.stdout.write(`v${OSRMWrapper_1.version}\n`);
4140
return;
4241
}
4342
if (argv._.length == 0 && !argv.shared_memory) {

routed-js/routed.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env node
22
import Fastify, { FastifyReply, FastifyRequest } from 'fastify';
3-
import { OSRMWrapper } from './OSRMWrapper';
3+
import { OSRMWrapper, version as OSRMVersion } from './OSRMWrapper';
44
import yargs from 'yargs/yargs';
55
import { routeSchema, nearestSchema, tableSchema, tripSchema, matchSchema, tileSchema, parseQueryString, parseCoordinatesAndFormat } from './schema';
66
import { ServiceHandler } from './ServiceHandler';
@@ -35,8 +35,7 @@ async function main() {
3535
.argv;
3636

3737
if (argv.version) {
38-
// TODO: print real version
39-
process.stdout.write('v5.27.0\n');
38+
process.stdout.write(`v${OSRMVersion}\n`);
4039
return;
4140
}
4241

0 commit comments

Comments
 (0)