Skip to content

Commit

Permalink
chore: add core tests to ci
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanFlurry committed Mar 7, 2024
1 parent 6c0d49d commit 287dda8
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 14 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/test_core.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Test Core

on:
- push

jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2

# Add private key to be able to access OpenGB repository
- uses: webfactory/ssh-agent@v0.9.0
with:
ssh-private-key: ${{ secrets.GH_DEPLOY_KEY }}

- name: Install Deno
uses: denoland/setup-deno@v1
with:
deno-version: "1.41.1"

- name: Test
run: deno task test:core
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: E2E
name: Test Project

on:
- push

Expand Down
6 changes: 5 additions & 1 deletion deno.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
// Generates schema
"artifacts:build:all": "deno task artifacts:build:schema && deno task artifacts:build:runtime_archive",
"artifacts:build:schema": "deno run --allow-env --allow-read --allow-write src/artifacts/build_schema.ts",
"artifacts:build:runtime_archive": "deno run --allow-env --allow-read --allow-write src/artifacts/build_runtime_archive.ts"
"artifacts:build:runtime_archive": "deno run --allow-env --allow-read --allow-write src/artifacts/build_runtime_archive.ts",

// Runs tests
"test:core": "deno task artifacts:build:all && deno test -A src/",
"test:project": "deno task cli:run test"
},
"lint": {
"include": ["src/"],
Expand Down
33 changes: 31 additions & 2 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 18 additions & 10 deletions src/template/template_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,26 @@ import { templateModule } from "./module.ts";
import { templateProject } from "./project.ts";
import { templateScript } from "./script.ts";

Deno.test("e2e", async () => {
const path = await Deno.makeTempDir();
Deno.test({
name: "e2e",

await templateProject(path);
// TODO: https://github.com/rivet-gg/open-game-services-engine/issues/35
sanitizeOps: false,
sanitizeResources: false,

await templateModule(await loadProject({ path }), "module_a");
async fn() {
const path = await Deno.makeTempDir();

await templateScript(await loadProject({ path }), "module_a", "script_a");
await templateProject(path);

await build(await loadProject({ path }), {
format: Format.Native,
runtime: Runtime.Deno,
dbDriver: DbDriver.NodePostgres,
});
await templateModule(await loadProject({ path }), "module_a");

await templateScript(await loadProject({ path }), "module_a", "script_a");

await build(await loadProject({ path }), {
format: Format.Native,
runtime: Runtime.Deno,
dbDriver: DbDriver.NodePostgres,
});
},
});

0 comments on commit 287dda8

Please sign in to comment.