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

ruspty init #1

Merged
merged 34 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
332f488
init
szymonkaliski Jan 23, 2024
4ae50c4
improve README
szymonkaliski Jan 24, 2024
3919c51
reshuffle ok/err handling
szymonkaliski Jan 24, 2024
d7b2dc4
ends -> pty_pair
szymonkaliski Jan 24, 2024
bd9c350
use ? in some places
szymonkaliski Jan 24, 2024
2017095
use ? in more places
szymonkaliski Jan 24, 2024
09a11d5
even more ?
szymonkaliski Jan 24, 2024
f6e080c
check result from termios
szymonkaliski Jan 24, 2024
33fc4cb
a comment
szymonkaliski Jan 24, 2024
8b02228
alpha version
szymonkaliski Jan 24, 2024
995c997
release alpha publicly
szymonkaliski Jan 24, 2024
8a02443
github ci
szymonkaliski Jan 24, 2024
ce10aaf
ci with bun
szymonkaliski Jan 24, 2024
5cdc61f
try install bun in docker
szymonkaliski Jan 24, 2024
128d5f1
more ci bun
szymonkaliski Jan 24, 2024
0924a4c
try bun docker container
szymonkaliski Jan 24, 2024
248bc68
adjust cwd test
szymonkaliski Jan 24, 2024
556be27
skip cwd test, fails on ci for whatever reason
szymonkaliski Jan 24, 2024
31967b7
try to fix test issue on linux ci
Jan 24, 2024
4bb01a6
skip flaky env test
szymonkaliski Jan 24, 2024
cea74ad
1.0.0-alpha.1
szymonkaliski Jan 24, 2024
6601371
testing publishing
szymonkaliski Jan 24, 2024
2916690
1.0.0-alpha.2
szymonkaliski Jan 24, 2024
05d79d8
1.0.0
szymonkaliski Jan 24, 2024
800eb43
more ci debugging
szymonkaliski Jan 24, 2024
0ce7f2a
force publish flow for v1.0.0
szymonkaliski Jan 24, 2024
742535b
undo force publish from previous commit
szymonkaliski Jan 24, 2024
1846e20
some info on publishing
szymonkaliski Jan 24, 2024
25a0071
new test & prettier
szymonkaliski Jan 30, 2024
0dcf1e7
attempt at cleaning up CI a bit
szymonkaliski Jan 30, 2024
cc0b74e
close the fd after child.wait()
szymonkaliski Jan 31, 2024
645d292
move around usafe {}
szymonkaliski Jan 31, 2024
852d90e
check for error when getting fcntl flags
szymonkaliski Jan 31, 2024
e06f061
more readable size using an object with named fields
szymonkaliski Jan 31, 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
201 changes: 201 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
name: CI
env:
DEBUG: napi:*
APP_NAME: ruspty
MACOSX_DEPLOYMENT_TARGET: '10.13'

permissions:
contents: write
id-token: write
'on':
push:
branches:
- main
tags-ignore:
- '**'
paths-ignore:
- '**/*.md'
- LICENSE
- '**/*.gitignore'
- .editorconfig
- docs/**
pull_request: null

jobs:
build:
strategy:
fail-fast: false
matrix:
settings:
- host: macos-latest
target: x86_64-apple-darwin
build: |
bun run build
strip -x *.node
- host: ubuntu-latest
target: x86_64-unknown-linux-gnu
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian
build: |-
set -e &&
npm install -g bun &&
bun run build --target x86_64-unknown-linux-gnu &&
strip *.node
name: Build on ${{ matrix.settings.target }}
runs-on: ${{ matrix.settings.host }}
steps:
- uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v1
- name: Setup node
uses: actions/setup-node@v4
if: ${{ !matrix.settings.docker }}
with:
node-version: 20
- name: Install
uses: dtolnay/rust-toolchain@stable
if: ${{ !matrix.settings.docker }}
with:
toolchain: stable
targets: ${{ matrix.settings.target }}
- name: Cache cargo
uses: actions/cache@v3
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: Install dependencies
run: bun install
- name: Build in docker
uses: addnab/docker-run-action@v3
if: ${{ matrix.settings.docker }}
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@v3
with:
name: bindings-${{ matrix.settings.target }}
path: ${{ env.APP_NAME }}.*.node
if-no-files-found: error

test-macos-binding:
name: Test on ${{ matrix.settings.target }}
needs:
- build
strategy:
matrix:
settings:
- host: macos-latest
target: x86_64-apple-darwin
runs-on: ${{ matrix.settings.host }}
steps:
- uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v1
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: bun install
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: bindings-${{ matrix.settings.target }}
path: .
- name: List packages
run: ls -R .
shell: bash
- name: Test bindings
run: bun test

test-linux-binding:
name: Test on ${{ matrix.settings.target }}
needs:
- build
strategy:
matrix:
settings:
- host: ubuntu-latest
target: x86_64-unknown-linux-gnu
runs-on: ${{ matrix.settings.host }}
steps:
- uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v1
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: bun install
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: bindings-${{ matrix.settings.target }}
path: .
- name: List packages
run: ls -R .
shell: bash
- name: Test bindings
run: docker run --rm -v $(pwd):/build -w /build oven/bun:1 bun test

publish:
name: Publish
runs-on: ubuntu-latest
needs:
- test-macos-binding
- test-linux-binding
steps:
- uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v1
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: bun install
- name: Download all artifacts
uses: actions/download-artifact@v3
with:
path: artifacts
- name: Move artifacts
run: bun run artifacts
- name: List packages
run: ls -R ./npm
shell: bash
- name: Publish
run: |
npm config set provenance true
if git log -1 --pretty=%B | grep "^[0-9]\+\.[0-9]\+\.[0-9]\+$";
then
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
npm publish --access public
elif git log -1 --pretty=%B | grep "^[0-9]\+\.[0-9]\+\.[0-9]\+";
then
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
npm publish --tag next --access public
else
echo "Not a release, skipping publish"
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
Loading
Loading