2022-11-29 04:14:27PM

This commit is contained in:
Alexander Wang 2022-11-29 16:14:27 -08:00
commit 34cd5191bd
No known key found for this signature in database
GPG key ID: D89FA31966BDBECE
8 changed files with 35 additions and 113 deletions

View file

@ -5,83 +5,15 @@ concurrency:
cancel-in-progress: true
jobs:
assert-linear:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- run: COLOR=1 ./make.sh assert-linear
env:
GITHUB_TOKEN: ${{ secrets._GITHUB_TOKEN }}
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/setup-go@v3
with:
go-version-file: ./go.mod
cache: true
- run: COLOR=1 ./make.sh fmt
env:
GITHUB_TOKEN: ${{ secrets._GITHUB_TOKEN }}
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
gen:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/setup-go@v3
with:
go-version-file: ./go.mod
cache: true
- run: COLOR=1 ./make.sh gen
env:
GITHUB_TOKEN: ${{ secrets._GITHUB_TOKEN }}
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/setup-go@v3
with:
go-version-file: ./go.mod
cache: true
- run: COLOR=1 ./make.sh lint
env:
GITHUB_TOKEN: ${{ secrets._GITHUB_TOKEN }}
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/setup-go@v3
with:
go-version-file: ./go.mod
cache: true
- run: COLOR=1 ./make.sh build
env:
GITHUB_TOKEN: ${{ secrets._GITHUB_TOKEN }}
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/setup-go@v3
with:
go-version-file: ./go.mod
cache: true
- run: COLOR=1 ./make.sh test
- run: COLOR=1 ./make.sh all race
env:
GITHUB_TOKEN: ${{ secrets._GITHUB_TOKEN }}
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
@ -90,22 +22,3 @@ jobs:
with:
name: d2chaos-test
path: ./d2chaos/out
race:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/setup-go@v3
with:
go-version-file: ./go.mod
cache: true
- run: COLOR=1 ./make.sh race
env:
GITHUB_TOKEN: ${{ secrets._GITHUB_TOKEN }}
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
- uses: actions/upload-artifact@v3
if: always()
with:
name: d2chaos-race
path: ./d2chaos/out

View file

@ -10,17 +10,15 @@ concurrency:
cancel-in-progress: true
jobs:
all:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/setup-go@v3
with:
go-version-file: ./go.mod
cache: true
- run: CI_ALL=1 COLOR=1 ./make.sh
- run: COLOR=1 CI_FORCE=1 ./make.sh all race
env:
GITHUB_TOKEN: ${{ secrets._GITHUB_TOKEN }}
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}

View file

@ -2,9 +2,6 @@
.PHONY: all
all: fmt gen lint build test
ifdef CI
all: assert-linear
endif
.PHONY: fmt
fmt:
@ -24,6 +21,3 @@ test:
.PHONY: race
race:
prefix "$@" ./ci/test.sh --race ./...
.PHONY: assert-linear
assert-linear:
prefix "$@" ./ci/sub/assert_linear.sh

View file

@ -14,7 +14,7 @@ help() {
fi
cat <<EOF
usage: $arg0 [--dry-run] [--version vX.X.X] [--edge] [--method detect] [--prefix /usr/local]
usage: $arg0 [-d|--dry-run] [--version vX.X.X] [--edge] [--method detect] [--prefix /usr/local]
[--tala latest] [--force] [--uninstall]
install.sh automates the installation of D2 onto your system. It currently only supports
@ -26,7 +26,7 @@ If you pass --edge, it will clone the source, build a release and install from i
Flags:
--dry-run
-d, --dry-run
Pass to have install.sh show the install method and flags that will be used to install
without executing them. Very useful to understand what changes it will make to your system.
@ -101,7 +101,7 @@ main() {
help
return 0
;;
dry-run)
d|dry-run)
flag_noarg && shift "$FLAGSHIFT"
DRY_RUN=1
;;
@ -188,12 +188,16 @@ main() {
if [ -n "${UNINSTALL-}" ]; then
uninstall
if [ -n "${DRY_RUN-}" ]; then
log "Rerun without --dry-run to execute printed commands and perform uninstall."
FGCOLOR=3 bigheader "***********
Rerun without --dry-run to execute printed commands and perform install.
***********"
fi
else
install
if [ -n "${DRY_RUN-}" ]; then
log "Rerun without --dry-run to execute printed commands and perform install."
FGCOLOR=3 bigheader "***********
Rerun without --dry-run to execute printed commands and perform install.
***********"
fi
fi
}

View file

@ -9,11 +9,15 @@
- `stroke-dash` on shapes is now supported. [#188](https://github.com/terrastruct/d2/issues/188)
- `font-color` is now supported on shapes and connections. [#215](https://github.com/terrastruct/d2/pull/215)
- Querying shapes and connections by ID is now supported in renders. [#218](https://github.com/terrastruct/d2/pull/218)
- [install.sh](./install.sh) now accepts `-d` as an alias for `--dry-run`.
[#266](https://github.com/terrastruct/d2/pull/266)
#### Improvements 🔧
- ELK layout engine now defaults to top-down to be consistent with dagre.
[#251](https://github.com/terrastruct/d2/pull/251)
- [install.sh](./install.sh) prints the dry run message more visibly.
[#266](https://github.com/terrastruct/d2/pull/266)
#### Bugfixes 🔴

View file

@ -62,7 +62,7 @@ should_color() {
_COLOR=1
return 0
else
printf '$COLOR must be 0, 1, false or true but got %s' "$COLOR" >&2
printf '$COLOR must be 0, 1, false or true but got %s\n' "$COLOR" >&2
fi
fi
@ -219,8 +219,9 @@ header() {
}
bigheader() {
set -- "$(echo "$*" | sed "s/^/ * /")"
logp "/**
* $1
$*
**/"
}

View file

@ -68,7 +68,7 @@ should_color() {
_COLOR=1
return 0
else
printf '$COLOR must be 0, 1, false or true but got %s' "$COLOR" >&2
printf '$COLOR must be 0, 1, false or true but got %s\n' "$COLOR" >&2
fi
fi
@ -225,8 +225,9 @@ header() {
}
bigheader() {
set -- "$(echo "$*" | sed "s/^/ * /")"
logp "/**
* $1
$*
**/"
}
@ -478,7 +479,7 @@ help() {
fi
cat <<EOF
usage: $arg0 [--dry-run] [--version vX.X.X] [--edge] [--method detect] [--prefix /usr/local]
usage: $arg0 [-d|--dry-run] [--version vX.X.X] [--edge] [--method detect] [--prefix /usr/local]
[--tala latest] [--force] [--uninstall]
install.sh automates the installation of D2 onto your system. It currently only supports
@ -490,7 +491,7 @@ If you pass --edge, it will clone the source, build a release and install from i
Flags:
--dry-run
-d, --dry-run
Pass to have install.sh show the install method and flags that will be used to install
without executing them. Very useful to understand what changes it will make to your system.
@ -565,7 +566,7 @@ main() {
help
return 0
;;
dry-run)
d|dry-run)
flag_noarg && shift "$FLAGSHIFT"
DRY_RUN=1
;;
@ -652,12 +653,16 @@ main() {
if [ -n "${UNINSTALL-}" ]; then
uninstall
if [ -n "${DRY_RUN-}" ]; then
log "Rerun without --dry-run to execute printed commands and perform uninstall."
FGCOLOR=3 bigheader "***********
Rerun without --dry-run to execute printed commands and perform install.
***********"
fi
else
install
if [ -n "${DRY_RUN-}" ]; then
log "Rerun without --dry-run to execute printed commands and perform install."
FGCOLOR=3 bigheader "***********
Rerun without --dry-run to execute printed commands and perform install.
***********"
fi
fi
}

View file

@ -1,5 +1,8 @@
#!/bin/sh
set -eu
if [ ! -d "$(dirname "$0")/ci/sub/.git" ]; then
git submodule update --init
fi
. "$(dirname "$0")/ci/sub/lib.sh"
PATH="$(cd -- "$(dirname "$0")" && pwd)/ci/sub/bin:$PATH"
cd "$(dirname "$0")"