Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: switch from sea-orm to diesel #8

Open
wants to merge 40 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
3545fd8
feat: switch to diesel
dan-online Apr 12, 2024
b754a72
chore: attempt to install in ci
dan-online Apr 12, 2024
0e1176f
ci: use correct libdir
dan-online Apr 12, 2024
28e1662
chore: add mysql paths to windows
dan-online Apr 12, 2024
b55b284
chore: use set
dan-online Apr 12, 2024
e594c0c
chore: set path too
dan-online Apr 12, 2024
561c26f
chore: use quotes
dan-online Apr 12, 2024
36b3a0e
chore: rename and update docs
dan-online Apr 12, 2024
8cf7d91
chore: change to setup and build
dan-online Apr 13, 2024
d68fae8
chore: move setup
dan-online Apr 13, 2024
dd528cc
ci: echo all variables to env
dan-online Apr 13, 2024
d18273e
chore: windows build sqlite3.lib
dan-online Apr 13, 2024
d6f34e5
fix: cd command
dan-online Apr 13, 2024
f193f2d
chore: add setup_cmd
dan-online Apr 13, 2024
bb14eec
chore: a bar
dan-online Apr 13, 2024
fec178d
chore: move sqlite install
dan-online Apr 13, 2024
640954b
chore: change order
dan-online Apr 13, 2024
5e3f681
chore: run dir
dan-online Apr 13, 2024
17c6446
chore: take out /D
dan-online Apr 13, 2024
3beda41
chore: remove x86
dan-online Apr 13, 2024
abe4bc1
chore: more library stuff
dan-online Apr 13, 2024
a2630b8
chore: preinstalled path?
dan-online Apr 13, 2024
e747d78
chore: use bundled versions
dan-online Sep 25, 2024
4cbdb37
chore: add some dependencies
dan-online Sep 26, 2024
6733353
chore: use lts
dan-online Sep 26, 2024
0a8d588
chore: update first
dan-online Sep 26, 2024
c142214
chore: update napi action
dan-online Sep 26, 2024
2e72050
ci: add devel
dan-online Sep 26, 2024
af23c90
chore: uses alpine
dan-online Sep 26, 2024
12d2f59
chore: use vendored openssl
dan-online Sep 26, 2024
764ba40
ci: more fixes
dan-online Sep 26, 2024
35be7ff
chore: remove set
dan-online Sep 26, 2024
f572b54
chore: remove newline
dan-online Sep 26, 2024
a04a8fe
chore: add openssl
dan-online Sep 26, 2024
0c84dfa
chore: add packages
dan-online Sep 26, 2024
fd7806d
chore: set openssl-sys vendored
dan-online Sep 26, 2024
2015ef5
chore: attempt for gnu
dan-online Sep 27, 2024
fac1291
chore: attempt to use cross
dan-online Sep 27, 2024
898e1b5
chore: use build:rs
dan-online Sep 27, 2024
862bdf3
chore: use vendored
dan-online Sep 27, 2024
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
298 changes: 121 additions & 177 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -1,225 +1,169 @@
name: CI
env:
DEBUG: napi:*
APP_NAME: brine
MACOSX_DEPLOYMENT_TARGET: '10.13'
permissions:
contents: write
id-token: write

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

'on':
name: Pure Rust project build on Linux
on:
push:
branches:
- main
tags:
- '*'
paths-ignore:
- '**/*.md'
- LICENSE
- '**/*.gitignore'
- .editorconfig
- docs/**
pull_request: null
pull_request:

env:
DEBUG: 'napi:*'
MACOSX_DEPLOYMENT_TARGET: '10.13'

jobs:
build:
strategy:
fail-fast: false
matrix:
settings:
- host: macos-latest
target: x86_64-apple-darwin
build: yarn build
- host: windows-latest
build: yarn build
target: x86_64-pc-windows-msvc
- host: ubuntu-latest
target: x86_64-unknown-linux-gnu
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian
build: |
sed -i 's/# openssl = { version = "0.10.64", features = \["vendored"\] }/openssl = { version = "0.10.64", features = \["vendored"\] }/' Cargo.toml
yarn build
name: stable - ${{ matrix.settings.target }} - node@20
runs-on: ${{ matrix.settings.host }}
targets:
[
'x86_64-apple-darwin',
'aarch64-apple-darwin',
'x86_64-pc-windows-msvc',
'i686-pc-windows-msvc',
'aarch64-pc-windows-msvc',
'x86_64-unknown-linux-gnu',
'aarch64-unknown-linux-gnu',
'x86_64-unknown-linux-musl',
'aarch64-unknown-linux-musl',
'armv7-unknown-linux-gnueabihf',
'aarch64-linux-android',
'armv7-linux-androideabi',
]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
if: ${{ !matrix.settings.docker }}
- name: Cache cargo registry
uses: actions/cache@v4
with:
node-version: 20
cache: yarn
path: |
~/.cargo
${{ github.workspace }}/.xwin
~/.napi-rs
./target
key: ${{ matrix.targets }}-cargo-cache
- name: Install
uses: dtolnay/rust-toolchain@stable
if: ${{ !matrix.settings.docker }}
with:
toolchain: stable
targets: ${{ matrix.settings.target }}
- name: Cache cargo
uses: actions/cache@v4
targets: ${{ matrix.targets }}
- uses: actions/setup-node@v4
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
.cargo-cache
target/
key: ${{ matrix.settings.target }}-cargo-${{ matrix.settings.host }}
- uses: goto-bus-stop/setup-zig@v2
if: ${{ matrix.settings.target == 'armv7-unknown-linux-gnueabihf' }}
with:
version: 0.11.0
- name: Setup toolchain
run: ${{ matrix.settings.setup }}
if: ${{ matrix.settings.setup }}
shell: bash
- name: Setup node x86
if: matrix.settings.target == 'i686-pc-windows-msvc'
run: yarn config set supportedArchitectures.cpu "ia32"
shell: bash
- name: Install dependencies
run: yarn install
- name: Setup node x86
uses: actions/setup-node@v4
if: matrix.settings.target == 'i686-pc-windows-msvc'
node-version: '20'
cache: 'yarn'
- name: Install ziglang
uses: goto-bus-stop/setup-zig@v1
with:
node-version: 20
cache: yarn
architecture: x86
- name: Build in docker
uses: addnab/docker-run-action@v3
if: ${{ matrix.settings.docker }}
version: 0.13.0
- name: Install cargo toolchains
uses: taiki-e/install-action@v2
env:
GITHUB_TOKEN: ${{ github.token }}
with:
image: ${{ matrix.settings.docker }}
options: '--user 0:0 -v ${{ github.workspace }}/.cargo-cache/git/db:/usr/local/cargo/git/db -v ${{ github.workspace }}/.cargo/registry/cache:/usr/local/cargo/registry/cache -v ${{ github.workspace }}/.cargo/registry/index:/usr/local/cargo/registry/index -v ${{ github.workspace }}:/build -w /build'
run: ${{ matrix.settings.build }}
- name: Build
run: ${{ matrix.settings.build }}
if: ${{ !matrix.settings.docker }}
shell: bash
- name: Upload artifact
uses: actions/upload-artifact@v4
tool: cargo-zigbuild,cargo-xwin
- run: yarn install
- run: yarn build:rs --target ${{ matrix.targets }}
env:
XWIN_CACHE_DIR: ${{ github.workspace }}/.xwin
- uses: actions/upload-artifact@v4
with:
name: bindings-${{ matrix.settings.target }}
path: native/${{ env.APP_NAME }}.*.node
name: bindings-${{ matrix.targets }}
path: native/*.node
if-no-files-found: error
test-macOS-windows-binding:
name: Test bindings on ${{ matrix.settings.target }} - node@${{ matrix.node }}
needs:
- build
test-host:
strategy:
fail-fast: false
matrix:
settings:
- host: macos-latest
target: x86_64-apple-darwin
- host: windows-latest
target: x86_64-pc-windows-msvc
node:
- '18'
- '20'
- target: x86_64-apple-darwin
host: macos-latest
- target: aarch64-apple-darwin
host: macos-latest
- target: x86_64-pc-windows-msvc
host: windows-latest
- target: i686-pc-windows-msvc
host: windows-latest
node: ['18', '20']
runs-on: ${{ matrix.settings.host }}
needs:
- build
steps:
- uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
- uses: actions/setup-node@v4
if: matrix.settings.target != 'aarch64-apple-darwin'
with:
node-version: ${{ matrix.node }}
cache: yarn
cache: 'yarn'
architecture: x64
- uses: actions/setup-node@v4
if: matrix.settings.target == 'aarch64-apple-darwin'
with:
node-version: ${{ matrix.node }}
cache: 'yarn'
architecture: arm64
- name: Setup node x86
if: matrix.settings.target == 'i686-pc-windows-msvc'
run: yarn config set supportedArchitectures.cpu "ia32"
shell: bash
- name: Install dependencies
run: yarn install
- name: Download artifacts
- name: Setup node x86
uses: actions/setup-node@v4
if: matrix.settings.target == 'i686-pc-windows-msvc'
with:
node-version: 20
cache: yarn
architecture: x86
- name: Download bindings
uses: actions/download-artifact@v4
with:
name: bindings-${{ matrix.settings.target }}
path: native
- name: List packages
run: ls -R .
shell: bash
- name: Test bindings
path: native/
- name: Run tests
run: yarn test
test-linux-x64-gnu-binding:
name: Test bindings on Linux-x64-gnu - node@${{ matrix.node }}
needs:
- build
test-docker:
strategy:
fail-fast: false
matrix:
node:
- '18'
- '20'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: yarn
- name: Install dependencies
run: yarn install
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: bindings-x86_64-unknown-linux-gnu
path: native
- name: List packages
run: ls -R .
shell: bash
- name: Test bindings
run: docker run --rm -v $(pwd):/build -w /build node:${{ matrix.node }}-slim yarn test
publish:
name: Publish
if: startsWith(github.ref, 'refs/tags/')
settings:
- target: x86_64-unknown-linux-gnu
docker: node:18-slim
args: ''
- target: aarch64-unknown-linux-gnu
docker: node:18-slim
args: '--platform linux/arm64'
- target: x86_64-unknown-linux-musl
docker: node:18-alpine
args: ''
- target: aarch64-unknown-linux-musl
docker: node:18-alpine
args: '--platform linux/arm64'
- target: armv7-unknown-linux-gnueabihf
docker: node:18-bullseye-slim
args: '--platform linux/arm/v7'
runs-on: ubuntu-latest
needs:
- test-macOS-windows-binding
- test-linux-x64-gnu-binding
- build
steps:
- uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn
cache: 'yarn'
- name: Install dependencies
run: yarn install
- name: Download all artifacts
- name: Download bindings
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Move artifacts
run: yarn artifacts
- name: List packages
run: ls -R ./npm
shell: bash
- name: Build TypeScript
run: yarn build:ts
- name: Publish
run: |
export npm_package_version=$(echo $GITHUB_REF | sed 's/refs\/tags\///')

npm version $npm_package_version --no-git-tag-version
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc

if [[ $npm_package_version == *-* ]]; then
npm publish --tag $(echo $npm_package_version | cut -d '-' -f 2) --access public
else
npm publish --access public
fi

git config --global user.email "dan@dancodes.online"
git config --global user.name "DanCodes"

jq 'del(.optionalDependencies)' package.json > package.json.tmp
mv package.json.tmp package.json

git add .
git commit -m "feat: release $npm_package_version [skip ci]"
git push origin HEAD:main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
name: bindings-${{ matrix.settings.target }}
path: native/
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: arm64,arm
- run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- name: Run tests
uses: addnab/docker-run-action@v3
with:
image: ${{ matrix.settings.docker }}
options: ${{ matrix.settings.args }} -v ${{ github.workspace }}:/build -w /build
run: yarn test
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -196,4 +196,5 @@ Cargo.lock

*.node

*.sqlite*
*.sqlite*
.envrc
Loading
Loading