-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Add tasks to run unit tests and GitHub workflow to run non-storag…
…e unit tests. (#30) Co-authored-by: kirkrodrigues <[email protected]>
- Loading branch information
1 parent
d307a2a
commit 1c8773a
Showing
8 changed files
with
122 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: "unit-tests" | ||
|
||
on: | ||
pull_request: | ||
push: | ||
schedule: | ||
# Run daily at 00:15 UTC (the 15 is to avoid periods of high load) | ||
- cron: "15 0 * * *" | ||
workflow_dispatch: | ||
|
||
permissions: {} | ||
|
||
concurrency: | ||
group: "${{github.workflow}}-${{github.ref}}" | ||
|
||
# Cancel in-progress jobs for efficiency | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
non-storage-unit-tests: | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- uses: "actions/checkout@v4" | ||
with: | ||
submodules: "recursive" | ||
|
||
- uses: "actions/setup-python@v5" | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: "Install task" | ||
run: "npm install -g @go-task/cli" | ||
|
||
- name: "Log tool versions" | ||
run: |- | ||
md5sum --version | ||
python --version | ||
tar --version | ||
task --version | ||
- name: "Install project dependencies " | ||
timeout-minutes: 10 | ||
run: "task deps:lib_install" | ||
|
||
- run: "task test:non-storage-unit-tests" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
version: "3" | ||
|
||
tasks: | ||
target: | ||
internal: true | ||
vars: | ||
TARGETS: | ||
ref: "default (list \"all\") .TARGETS" | ||
deps: [":config-cmake-project"] | ||
cmds: | ||
- >- | ||
cmake | ||
--build "{{.G_BUILD_SPIDER_DIR}}" | ||
--parallel {{numCPU}} | ||
--target {{range .TARGETS}}{{.}} {{end}} | ||
clean: | ||
internal: true | ||
deps: [":config-cmake-project"] | ||
cmds: | ||
- "cmake --build {{.G_BUILD_SPIDER_DIR}} --target clean --parallel {{numCPU}}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
version: "3" | ||
|
||
vars: | ||
G_TEST_BINARY: "{{.G_BUILD_SPIDER_DIR}}/tests/unitTest" | ||
|
||
tasks: | ||
non-storage-unit-tests: | ||
deps: | ||
- "build-unit-test" | ||
cmds: | ||
- "{{.G_TEST_BINARY}} \"~[storage]\"" | ||
|
||
storage-unit-tests: | ||
deps: | ||
- "build-unit-test" | ||
cmds: | ||
- "{{.G_TEST_BINARY}} \"[storage]\"" | ||
|
||
all: | ||
deps: | ||
- "build-unit-test" | ||
cmds: | ||
- "{{.G_TEST_BINARY}}" | ||
|
||
build-unit-test: | ||
internal: true | ||
deps: | ||
- task: ":build:target" | ||
vars: | ||
TARGETS: ["spider_task_executor", "unitTest", "worker_test"] |