Skip to content

Commit

Permalink
Update github workflows (#1178)
Browse files Browse the repository at this point in the history
CLI still doesn't recognise [gel] inside gel.toml. So I updated our
`gel.toml` files inside test folders to use `egdedb`.

Do we want to run some CI tests on Windows machines? All tests we have
run on ubuntu.

At the end I reverted tests to use `edgedb` for the CLI (`edgedb
migrate` etc...) in order to use the current `setup-edgedb` action.
  • Loading branch information
diksipav committed Jan 23, 2025
1 parent 2efc7e9 commit d610f48
Show file tree
Hide file tree
Showing 9 changed files with 139 additions and 148 deletions.
187 changes: 91 additions & 96 deletions .github/workflows/release.yml

Large diffs are not rendered by default.

70 changes: 35 additions & 35 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,24 @@ jobs:
matrix:
node-version: ["18", "20", "22"]
os: [ubuntu-latest]
edgedb-version: ["stable"]
gel-version: ["stable"]
include:
- os: ubuntu-latest
node-version: "20"
edgedb-version: "nightly"
gel-version: "nightly"
- os: ubuntu-latest
node-version: "20"
edgedb-version: "5"
gel-version: "5"
- os: ubuntu-latest
node-version: "20"
edgedb-version: "4"
gel-version: "4"
# - os: ubuntu-latest
# node-version: "20"
# edgedb-version: "3"
# gel-version: "3"
# XXX: macOS is currently unsupported by setup-edgedb
# - os: macos-latest
# node-version: "20"
# edgedb-version: "stable"
# gel-version: "stable"

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -77,16 +77,16 @@ jobs:
run: |
yarn format
- name: Install EdgeDB
- name: Install Gel
uses: edgedb/setup-edgedb@6763b6de72782d9c2e5ecc1095986a1c707da68f
with:
instance-name: test
server-version: ${{ matrix.edgedb-version }}
cli-version: ${{ matrix.edgedb-version == 'nightly' && 'nightly' || 'stable' }}
server-version: ${{ matrix.gel-version }}
cli-version: ${{ matrix.gel-version == 'nightly' && 'nightly' || 'stable' }}

- name: Show actual EdgeDB server version
- name: Show actual Gel server version
run: |
echo ACTIVE_EDGEDB_VERSION=$(edgedb query 'select sys::get_version_as_str()' -I test) >> $GITHUB_ENV
echo ACTIVE_GEL_VERSION=$(gel query 'select sys::get_version_as_str()' -I test) >> $GITHUB_ENV
- name: Install postgis extension
if: ${{ matrix.edgedb-version == 'nightly' }}
Expand All @@ -98,20 +98,20 @@ jobs:
yarn ci:test
- name: Run query builder integration tests lts
if: ${{ matrix.edgedb-version == '3' || matrix.edgedb-version == '4' || matrix.edgedb-version == 'stable' || matrix.edgedb-version == 'nightly' }}
if: ${{ matrix.gel-version == '3' || matrix.gel-version == '4' || matrix.gel-version == 'stable' || matrix.gel-version == 'nightly' }}
run: |
turbo run ci:integration-test --filter=@edgedb/integration-lts
turbo run bench:types --filter=@edgedb/integration-lts || echo "Benchmark types script failed, proceeding anyway."
turbo run ci:integration-test --filter=@gel/integration-lts
turbo run bench:types --filter=@gel/integration-lts || echo "Benchmark types script failed, proceeding anyway."
- name: Run query builder integration tests stable
if: ${{ matrix.edgedb-version == 'stable' || matrix.edgedb-version == 'nightly' }}
if: ${{ matrix.gel-version == 'stable' || matrix.gel-version == 'nightly' }}
run: |
turbo run ci:integration-test --filter=@edgedb/integration-stable
turbo run ci:integration-test --filter=@gel/integration-stable
- name: Run query builder integration tests nightly
if: ${{ matrix.edgedb-version == 'nightly' }}
if: ${{ matrix.gel-version == 'nightly' }}
run: |
turbo run ci:integration-test --filter=@edgedb/integration-nightly
turbo run ci:integration-test --filter=@gel/integration-nightly
- name: Typecheck other packages
run: |
Expand Down Expand Up @@ -150,28 +150,28 @@ jobs:
- name: Build and pack CLI wrapper
run: |
yarn workspace edgedb run build
yarn workspace edgedb pack --filename=${{ github.workspace }}/edgedb-cli.tar.gz
yarn workspace gel run build
yarn workspace gel pack --filename=${{ github.workspace }}/edgedb-cli.tar.gz
- name: Test CLI wrapper with npm
run: |
mkdir ${{ runner.temp }}/temp-npm
cd ${{ runner.temp }}/temp-npm
npm init -y
npm install ${{ github.workspace }}/edgedb-cli.tar.gz
npm exec edgedb -- project init --non-interactive
npm exec edgedb -- --version
npm exec edgedb -- query 'select sys::get_version_as_str()'
npm exec gel -- project init --non-interactive
npm exec gel -- --version
npm exec gel -- query 'select sys::get_version_as_str()'
- name: Test CLI wrapper with yarn
run: |
mkdir ${{ runner.temp }}/temp-yarn
cd ${{ runner.temp }}/temp-yarn
yarn init -y
yarn add ${{ github.workspace}}/edgedb-cli.tar.gz
yarn edgedb project init --non-interactive
yarn edgedb --version
yarn edgedb query 'select sys::get_version_as_str()'
yarn gel project init --non-interactive
yarn gel --version
yarn gel query 'select sys::get_version_as_str()'
- uses: threeal/setup-yarn-action@ec8c075e62bc497968de40011c2b766f5e8f1ac5
with:
Expand All @@ -185,9 +185,9 @@ jobs:
yarn init -y
touch yarn.lock
yarn add ${{ github.workspace }}/edgedb-cli.tar.gz
yarn edgedb project init --non-interactive
yarn edgedb --version
yarn edgedb query 'select sys::get_version_as_str()'
yarn gel project init --non-interactive
yarn gel --version
yarn gel query 'select sys::get_version_as_str()'
- uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d
with:
Expand All @@ -199,9 +199,9 @@ jobs:
cd ${{ runner.temp}}/temp-pnpm
pnpm init
pnpm add ${{ github.workspace }}/edgedb-cli.tar.gz
pnpm exec edgedb project init --non-interactive
pnpm exec edgedb --version
pnpm exec edgedb query 'select sys::get_version_as_str()'
pnpm exec gel project init --non-interactive
pnpm exec gel --version
pnpm exec gel query 'select sys::get_version_as_str()'
- uses: oven-sh/setup-bun@8f24390df009a496891208e5e36b8a1de1f45135
- name: Test CLI wrapper with bun
Expand All @@ -210,6 +210,6 @@ jobs:
cd temp-bun
bun init
bun add ${{ github.workspace }}/edgedb-cli.tar.gz
bun edgedb project init --non-interactive
bun edgedb --version
bun edgedb query 'select sys::get_version_as_str()'
bun gel project init --non-interactive
bun gel --version
bun gel query 'select sys::get_version_as_str()'
2 changes: 1 addition & 1 deletion integration-tests/legacy/gel.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gel]
[edgedb]
server-version = "2"

[project]
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/lts/gel.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[gel]
[edgedb]
server-version = "3"
2 changes: 1 addition & 1 deletion integration-tests/nightly/gel.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[gel]
[edgedb]
server-version = "nightly"
2 changes: 1 addition & 1 deletion integration-tests/stable/gel.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[gel]
[edgedb]
server-version = "5"
12 changes: 7 additions & 5 deletions packages/driver/test/testUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,10 @@ export const getServerCommand = (
strictSecurity = true,
): { args: string[]; availableFeatures: string[] } => {
const availableFeatures: string[] = [];
const srvcmd = process.env.GEL_SERVER_BIN || "gel-server";

// we can check version here and use gel-server for newer versions
// but edgedb-server works for all versions
const srvcmd = process.env.GEL_SERVER_BIN || "edgedb-server";

let args = [srvcmd];
if (process.platform === "win32") {
Expand Down Expand Up @@ -127,7 +130,6 @@ export const getServerCommand = (
`--security=${strictSecurity ? "strict" : "insecure_dev_mode"}`,
"--bootstrap-command=ALTER ROLE edgedb { SET password := 'edgedbtest' }",
];

return { args, availableFeatures };
};

Expand Down Expand Up @@ -295,20 +297,20 @@ export async function applyMigrations(
if (process.platform === "win32") {
await runCommand("wsl", [
"-u",
"gel",
"edgedb",
"env",
...Object.entries(configToEnv(config)).map(
([key, val]) => `${key}=${val}`,
),
"gel",
"edgedb",
"migrate",
...(params?.flags || []),
"--schema-dir",
getWSLPath(path.join(process.cwd(), "dbschema")),
]);
} else {
await runCommand(
"gel",
"edgedb",
["migrate", ...(params?.flags || [])],
configToEnv(config),
);
Expand Down
2 changes: 1 addition & 1 deletion packages/generate/gel.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[gel]
[edgedb]
server-version = "nightly"
8 changes: 1 addition & 7 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,7 @@
]
},
"ci:test": {
"dependsOn": [
"build",
"gel#test",
"@gel/auth-core#test",
"@gel/create#test",
"@gel/ai#test"
],
"dependsOn": ["build", "gel#test", "@gel/auth-core#test"],
"env": ["CI", "GEL_SERVER_BIN"]
},
"ci:integration-test": {
Expand Down

0 comments on commit d610f48

Please sign in to comment.