Skip to content

Commit

Permalink
chore: Update deps (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
LekoArts authored Jul 11, 2024
1 parent 279eda5 commit aab3038
Show file tree
Hide file tree
Showing 8 changed files with 857 additions and 496 deletions.
47 changes: 16 additions & 31 deletions .github/workflows/build_and_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ env:
APP_NAME: thanks-contributors
MACOSX_DEPLOYMENT_TARGET: "10.13"
RUST_BACKTRACE: full
NODE_VERSION: 16
NODE_VERSION: 20

on:
push:
Expand Down Expand Up @@ -39,18 +39,13 @@ jobs:
name: build-${{ matrix.target }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
check-latest: true
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- uses: dtolnay/rust-toolchain@stable
- name: Setup rust target
run: rustup target add ${{ matrix.target }}
- name: Install dependencies
Expand All @@ -62,7 +57,7 @@ jobs:
if: ${{ matrix.strip }}
run: ${{ matrix.strip }} *.node
- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: bindings-${{ matrix.target }}
path: ${{ env.APP_NAME }}.*.node
Expand All @@ -72,18 +67,13 @@ jobs:
name: build-apple-silicon
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
check-latest: true
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- uses: dtolnay/rust-toolchain@stable
- name: Setup rust target
run: rustup target add aarch64-apple-darwin
- name: Install dependencies
Expand All @@ -100,7 +90,7 @@ jobs:
- name: Strip debug symbols
run: strip -x *.node
- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: bindings-aarch64-apple-darwin
path: ${{ env.APP_NAME }}.*.node
Expand Down Expand Up @@ -135,18 +125,13 @@ jobs:
runs-on: ubuntu-latest
container: ${{ matrix.image }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
check-latest: true
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
override: true
toolchain: stable
- uses: dtolnay/rust-toolchain@stable
- uses: goto-bus-stop/setup-zig@v2
if: ${{ matrix.target == 'armv7-unknown-linux-gnueabihf' }}
with:
Expand All @@ -166,7 +151,7 @@ jobs:
if: ${{ matrix.strip }}
run: ${{ matrix.strip }} *.node
- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: bindings-${{ matrix.target }}
path: ${{ env.APP_NAME }}.*.node
Expand All @@ -180,16 +165,16 @@ jobs:
- build-apple-silicon
- build-linux
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
check-latest: true
- name: Install dependencies
uses: ./.github/actions/yarn-install
- name: Download all artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Move artifacts
Expand Down
22 changes: 7 additions & 15 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:

env:
CARGO_TERM_COLOR: always
RUSTFLAGS: -D warnings

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand All @@ -17,18 +18,9 @@ jobs:
fmt-clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: rustfmt
run: cargo fmt --all -- --check
- name: Run Clippy
run: cargo clippy --all-targets --all-features
14 changes: 7 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,30 +24,30 @@ jobs:
RUST_BACKTRACE: full
RUSTFLAGS: -D warnings
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v1
- uses: Swatinem/rust-cache@v2
- run: cargo test --all-features
test-js:
name: Unit Tests - Node@${{ matrix.node }}
name: Unit Tests - Node ${{ matrix.node }}
strategy:
fail-fast: false
matrix:
node:
- "16"
- "18"
- "20"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
check-latest: true
- name: Install dependencies
uses: ./.github/actions/yarn-install
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v1
- uses: Swatinem/rust-cache@v2
- name: Build
run: yarn build
- name: Run Vitest
Expand Down
16 changes: 8 additions & 8 deletions __tests__/__snapshots__/cli.ts.snap
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
// Vitest Snapshot v1
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`cli > should error on invalid commits range 1`] = `
"[Error: Failed to parse response body: error decoding response body: missing field \`commits\` at line 1 column 110] {
"[Error: Failed to parse response body: error decoding response body: missing field \`commits\` at line 1 column 125] {
code: 'GenericFailure'
}"
`;

exports[`cli > should error without required arguments 1`] = `
"error: The following required arguments were not provided:
"error: the following required arguments were not provided:
<BASE>
<HEAD>
Usage: @lekoarts/thanks-contributors <BASE> <HEAD> [OWNER] [REPO]
For more information try '--help'"
For more information, try '--help'."
`;
exports[`cli > should show help command 1`] = `
Expand Down Expand Up @@ -48,14 +48,14 @@ Options:
-e, --excludes <EXCLUDES>...
List of members to exclude from the list. Usage: -e=member1,member2 [default:
\\"renovate-bot\\", \\"renovate[bot]\\"]
"renovate-bot", "renovate[bot]"]
-v, --verbose...
More output per occurrence
Increase logging verbosity
-q, --quiet...
Less output per occurrence
Decrease logging verbosity
-h, --help
Print help information (use \`-h\` for a summary)"
Print help (see a summary with '-h')"
`;
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

/* auto-generated by NAPI-RS */

export function run(args: Array<string>): Promise<void>
export declare function run(args: Array<string>): Promise<void>
72 changes: 68 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/* tslint:disable */
/* eslint-disable */
/* prettier-ignore */

/* auto-generated by NAPI-RS */

const { existsSync, readFileSync } = require('fs')
const { join } = require('path')

Expand All @@ -11,7 +17,7 @@ function isMusl() {
// For Node 10
if (!process.report || typeof process.report.getReport !== 'function') {
try {
const lddPath = require('child_process').execSync('which ldd').toString().trim();
const lddPath = require('child_process').execSync('which ldd').toString().trim()
return readFileSync(lddPath, 'utf8').includes('musl')
} catch (e) {
return true
Expand Down Expand Up @@ -218,14 +224,72 @@ switch (platform) {
}
break
case 'arm':
if (isMusl()) {
localFileExisted = existsSync(
join(__dirname, 'thanks-contributors.linux-arm-musleabihf.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./thanks-contributors.linux-arm-musleabihf.node')
} else {
nativeBinding = require('@lekoarts/thanks-contributors-linux-arm-musleabihf')
}
} catch (e) {
loadError = e
}
} else {
localFileExisted = existsSync(
join(__dirname, 'thanks-contributors.linux-arm-gnueabihf.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./thanks-contributors.linux-arm-gnueabihf.node')
} else {
nativeBinding = require('@lekoarts/thanks-contributors-linux-arm-gnueabihf')
}
} catch (e) {
loadError = e
}
}
break
case 'riscv64':
if (isMusl()) {
localFileExisted = existsSync(
join(__dirname, 'thanks-contributors.linux-riscv64-musl.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./thanks-contributors.linux-riscv64-musl.node')
} else {
nativeBinding = require('@lekoarts/thanks-contributors-linux-riscv64-musl')
}
} catch (e) {
loadError = e
}
} else {
localFileExisted = existsSync(
join(__dirname, 'thanks-contributors.linux-riscv64-gnu.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./thanks-contributors.linux-riscv64-gnu.node')
} else {
nativeBinding = require('@lekoarts/thanks-contributors-linux-riscv64-gnu')
}
} catch (e) {
loadError = e
}
}
break
case 's390x':
localFileExisted = existsSync(
join(__dirname, 'thanks-contributors.linux-arm-gnueabihf.node')
join(__dirname, 'thanks-contributors.linux-s390x-gnu.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./thanks-contributors.linux-arm-gnueabihf.node')
nativeBinding = require('./thanks-contributors.linux-s390x-gnu.node')
} else {
nativeBinding = require('@lekoarts/thanks-contributors-linux-arm-gnueabihf')
nativeBinding = require('@lekoarts/thanks-contributors-linux-s390x-gnu')
}
} catch (e) {
loadError = e
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
],
"license": "MIT",
"devDependencies": {
"@napi-rs/cli": "^2.14.0",
"@types/prettier": "^2.7.2",
"execa": "^6.1.0",
"prettier": "^2.8.1",
"strip-ansi": "^7.0.1",
"vitest": "^0.26.2"
"@napi-rs/cli": "^2.18.4",
"@types/prettier": "^3.0.0",
"execa": "^9.3.0",
"prettier": "^3.3.2",
"strip-ansi": "^7.1.0",
"vitest": "^2.0.2"
},
"engines": {
"node": ">= 14"
Expand Down
Loading

0 comments on commit aab3038

Please sign in to comment.