Skip to content

Commit 5d4acb7

Browse files
committed
test
1 parent fb4b45e commit 5d4acb7

File tree

2 files changed

+119
-105
lines changed

2 files changed

+119
-105
lines changed

.github/workflows/release.yml

Lines changed: 87 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -69,100 +69,100 @@ jobs:
6969
ref: ${{ needs.version-and-tag.outputs.tag }}
7070
runs-on: ${{ matrix.os }}
7171

72-
bundle-linux:
73-
needs: [ get-configs, version-and-tag, build-and-test ]
74-
strategy:
75-
fail-fast: true
76-
matrix:
77-
include:
78-
- { arch: "x64", docker-platform: "linux/amd64", go-arch: "amd64", use_qemu: false, node-version: "22" }
79-
- { arch: "arm64", docker-platform: "linux/arm64", go-arch: "arm64", use_qemu: true, node-version: "22" }
80-
runs-on: ubuntu-22.04
81-
steps:
82-
- uses: actions/checkout@v5
83-
with:
84-
ref: ${{ needs.version-and-tag.outputs.tag }}
85-
fetch-tags: true
86-
87-
- name: Set release asset name
88-
id: set-asset-name
89-
shell: bash
90-
run: |
91-
APP_NAME=${{ needs.get-configs.outputs.app-name }}
92-
VERSION=$(node -p "require('./package.json').version")
93-
NODE_VERSION=${{ matrix.node-version }}
94-
NODE_MAJOR=$(echo $NODE_VERSION | cut -d. -f1)
95-
96-
TAG=${{ needs.version-and-tag.outputs.tag }}
97-
if [[ "$TAG" =~ -alpha$ ]]; then
98-
FILE_NAME="${APP_NAME}-${VERSION}-alpha-linux-${{ matrix.arch }}-node${NODE_MAJOR}"
99-
elif [[ "$TAG" =~ -beta$ ]]; then
100-
FILE_NAME="${APP_NAME}-${VERSION}-beta-linux-${{ matrix.arch }}-node${NODE_MAJOR}"
101-
else
102-
FILE_NAME="${APP_NAME}-${VERSION}-linux-${{ matrix.arch }}-node${NODE_MAJOR}"
103-
fi
104-
105-
ASSET_NAME=$(echo "$FILE_NAME" | tr '[:upper:]' '[:lower:]')
106-
echo "ASSET_NAME=${ASSET_NAME}" >> $GITHUB_OUTPUT
107-
108-
- name: Set up QEMU
109-
if: matrix.use_qemu
110-
uses: docker/setup-qemu-action@v3
111-
112-
- name: Bundle (${{ matrix.docker-platform }}
113-
run: |
114-
docker run --rm -v ${{ github.workspace }}:/work -w /work \
115-
--platform ${{ matrix.docker-platform }} \
116-
amazonlinux:2023 \
117-
/bin/bash -c '
118-
set -ex
119-
yum install -y make gcc-c++ python3 tar gzip wget tree
120-
121-
wget -q https://go.dev/dl/go${{ needs.get-configs.outputs.go-version }}.linux-${{ matrix.go-arch }}.tar.gz
122-
tar -C /usr/local -xzf go${{ needs.get-configs.outputs.go-version }}.linux-${{ matrix.go-arch }}.tar.gz
123-
export PATH=$PATH:/usr/local/go/bin
124-
125-
curl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
126-
export NVM_DIR="$HOME/.nvm"
127-
. "$NVM_DIR/nvm.sh"
128-
nvm install ${{ matrix.node-version }}
129-
nvm use ${{ matrix.node-version }}
130-
131-
npm ci
132-
133-
TAG="${{ needs.version-and-tag.outputs.tag }}"
134-
if [[ "$TAG" =~ -alpha$ ]]; then
135-
npm run bundle:alpha
136-
elif [[ "$TAG" =~ -beta$ ]]; then
137-
npm run bundle:beta
138-
else
139-
npm run bundle:prod
140-
fi
141-
142-
tree -f bundle/production/node_modules/tree-sitter
143-
tree -f bundle/production/node_modules/tree-sitter-json
144-
145-
GOARCH=${{ matrix.go-arch }} go build -C ./cfn-init/cmd -v -o ../../bundle/production/bin/cfn-init
146-
cp ./cfn-init/THIRD-PARTY-LICENSES.txt ./bundle/production/bin/
147-
'
148-
149-
- name: Upload artifact
150-
uses: actions/upload-artifact@v4
151-
with:
152-
name: ${{ steps.set-asset-name.outputs.ASSET_NAME }}
153-
path: bundle/production/
154-
if-no-files-found: error
155-
include-hidden-files: true
156-
compression-level: 6
72+
# bundle-linux:
73+
# needs: [ get-configs, version-and-tag, build-and-test ]
74+
# strategy:
75+
# fail-fast: true
76+
# matrix:
77+
# include:
78+
# - { arch: "x64", docker-platform: "linux/amd64", go-arch: "amd64", use_qemu: false, node-version: "22" }
79+
# - { arch: "arm64", docker-platform: "linux/arm64", go-arch: "arm64", use_qemu: true, node-version: "22" }
80+
# runs-on: ubuntu-22.04
81+
# steps:
82+
# - uses: actions/checkout@v5
83+
# with:
84+
# ref: ${{ needs.version-and-tag.outputs.tag }}
85+
# fetch-tags: true
86+
#
87+
# - name: Set release asset name
88+
# id: set-asset-name
89+
# shell: bash
90+
# run: |
91+
# APP_NAME=${{ needs.get-configs.outputs.app-name }}
92+
# VERSION=$(node -p "require('./package.json').version")
93+
# NODE_VERSION=${{ matrix.node-version }}
94+
# NODE_MAJOR=$(echo $NODE_VERSION | cut -d. -f1)
95+
#
96+
# TAG=${{ needs.version-and-tag.outputs.tag }}
97+
# if [[ "$TAG" =~ -alpha$ ]]; then
98+
# FILE_NAME="${APP_NAME}-${VERSION}-alpha-linux-${{ matrix.arch }}-node${NODE_MAJOR}"
99+
# elif [[ "$TAG" =~ -beta$ ]]; then
100+
# FILE_NAME="${APP_NAME}-${VERSION}-beta-linux-${{ matrix.arch }}-node${NODE_MAJOR}"
101+
# else
102+
# FILE_NAME="${APP_NAME}-${VERSION}-linux-${{ matrix.arch }}-node${NODE_MAJOR}"
103+
# fi
104+
#
105+
# ASSET_NAME=$(echo "$FILE_NAME" | tr '[:upper:]' '[:lower:]')
106+
# echo "ASSET_NAME=${ASSET_NAME}" >> $GITHUB_OUTPUT
107+
#
108+
# - name: Set up QEMU
109+
# if: matrix.use_qemu
110+
# uses: docker/setup-qemu-action@v3
111+
#
112+
# - name: Bundle (${{ matrix.docker-platform }}
113+
# run: |
114+
# docker run --rm -v ${{ github.workspace }}:/work -w /work \
115+
# --platform ${{ matrix.docker-platform }} \
116+
# amazonlinux:2023 \
117+
# /bin/bash -c '
118+
# set -ex
119+
# yum install -y make gcc-c++ python3 tar gzip wget tree
120+
#
121+
# wget -q https://go.dev/dl/go${{ needs.get-configs.outputs.go-version }}.linux-${{ matrix.go-arch }}.tar.gz
122+
# tar -C /usr/local -xzf go${{ needs.get-configs.outputs.go-version }}.linux-${{ matrix.go-arch }}.tar.gz
123+
# export PATH=$PATH:/usr/local/go/bin
124+
#
125+
# curl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
126+
# export NVM_DIR="$HOME/.nvm"
127+
# . "$NVM_DIR/nvm.sh"
128+
# nvm install ${{ matrix.node-version }}
129+
# nvm use ${{ matrix.node-version }}
130+
#
131+
# npm ci
132+
#
133+
# TAG="${{ needs.version-and-tag.outputs.tag }}"
134+
# if [[ "$TAG" =~ -alpha$ ]]; then
135+
# npm run bundle:alpha
136+
# elif [[ "$TAG" =~ -beta$ ]]; then
137+
# npm run bundle:beta
138+
# else
139+
# npm run bundle:prod
140+
# fi
141+
#
142+
# tree -f bundle/production/node_modules/tree-sitter
143+
# tree -f bundle/production/node_modules/tree-sitter-json
144+
#
145+
# GOARCH=${{ matrix.go-arch }} go build -C ./cfn-init/cmd -v -o ../../bundle/production/bin/cfn-init
146+
# cp ./cfn-init/THIRD-PARTY-LICENSES.txt ./bundle/production/bin/
147+
# '
148+
#
149+
# - name: Upload artifact
150+
# uses: actions/upload-artifact@v4
151+
# with:
152+
# name: ${{ steps.set-asset-name.outputs.ASSET_NAME }}
153+
# path: bundle/production/
154+
# if-no-files-found: error
155+
# include-hidden-files: true
156+
# compression-level: 6
157157

158158
bundle-win-mac:
159159
needs: [ get-configs, version-and-tag, build-and-test ]
160160
strategy:
161161
fail-fast: true
162162
matrix:
163163
include:
164-
- { os: "macos-latest", arch: "x64", platform: "darwin", go-arch: "amd64", node-version: "22.x" }
165-
- { os: "macos-latest", arch: "arm64", platform: "darwin", go-arch: "arm64", node-version: "22.x" }
164+
# - { os: "macos-latest", arch: "x64", platform: "darwin", go-arch: "amd64", node-version: "22.x" }
165+
# - { os: "macos-latest", arch: "arm64", platform: "darwin", go-arch: "arm64", node-version: "22.x" }
166166
- { os: "windows-latest", arch: "x64", platform: "win32", go-arch: "amd64", node-version: "22.x" }
167167
- { os: "windows-11-arm", arch: "arm64", platform: "win32", go-arch: "arm64", node-version: "22.x" }
168168
runs-on: ${{ matrix.os }}

src/datastore/LMDB.ts

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,23 @@ export class LMDBStore implements DataStore {
2222
}
2323

2424
get<T>(key: string): T | undefined {
25-
return this.store.get(key) as T | undefined;
25+
try {
26+
return this.store.get(key) as T | undefined;
27+
} catch (err) {
28+
log.error(err);
29+
throw err;
30+
}
2631
}
2732

2833
put<T>(key: string, value: T): Promise<boolean> {
29-
return this.telemetry.measureAsync('put', () => {
30-
return this.store.put(key, value);
31-
});
34+
try {
35+
return this.telemetry.measureAsync('put', () => {
36+
return this.store.put(key, value);
37+
});
38+
} catch (err) {
39+
log.error(err);
40+
throw err;
41+
}
3242
}
3343

3444
remove(key: string): Promise<boolean> {
@@ -87,24 +97,28 @@ export class LMDBStoreFactory implements DataStoreFactory {
8797
}
8898

8999
getOrCreate(store: string): DataStore {
90-
let val = this.stores.get(store);
91-
if (val === undefined) {
92-
let database;
93-
this.env.transactionSync(() => {
94-
database = this.env.openDB<unknown, string>({
95-
name: store,
96-
encoding: Encoding,
100+
try {
101+
let val = this.stores.get(store);
102+
if (val === undefined) {
103+
let database;
104+
this.env.transactionSync(() => {
105+
database = this.env.openDB<unknown, string>({
106+
name: store,
107+
encoding: Encoding,
108+
});
97109
});
98-
});
99110

100-
if (database === undefined) {
101-
throw new Error(`Failed to open LMDB store ${store}`);
111+
if (database === undefined) {
112+
throw new Error(`Failed to open LMDB store ${store}`);
113+
}
114+
val = new LMDBStore(store, database);
115+
this.stores.set(store, val);
102116
}
103-
val = new LMDBStore(store, database);
104-
this.stores.set(store, val);
117+
return val;
118+
} catch (err) {
119+
log.error(err);
120+
throw err;
105121
}
106-
107-
return val;
108122
}
109123

110124
storeNames(): ReadonlyArray<string> {

0 commit comments

Comments
 (0)