Repository navigation
ci: Add tasks to run unit tests and GitHub workflow to run non-storage unit tests. #30
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
Changes from 5 commits
f07a767
0d75528
783b950
cb1695e
ab005e9
31e43a1
24d020f
4616e10
8cd345b
6456a89
28019b3
6e19d7b
229eed3
2d2e4f5
fba9166
0ef39ad
538a03c
a7f403a
47bcbf2
4da8582
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| 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: | ||
| lint: | ||
| strategy: | ||
| matrix: | ||
| os: ["ubuntu-latest"] | ||
| runs-on: "${{matrix.os}}" | ||
|
kirkrodrigues marked this conversation as resolved.
Resolved
|
||
| 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" | ||
|
|
||
| - if: "matrix.os == 'macos-latest'" | ||
| name: "Install coreutils (for md5sum)" | ||
| run: "brew install coreutils" | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove or enable macOS-specific step. There's a macOS-specific step for installing coreutils, but macOS isn't included in the OS matrix. Either remove this step or add macOS to the matrix as suggested above.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The rabbit is correct.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @kirkrodrigues, glad I could help! |
||
| - name: "Log tool versions" | ||
| run: |- | ||
| md5sum --version | ||
| python --version | ||
| tar --version | ||
| task --version | ||
|
|
||
| - name: "Install project dependencies " | ||
| timeout-minutes: 10 | ||
| continue-on-error: false | ||
|
kirkrodrigues marked this conversation as resolved.
Resolved
|
||
| run: "task deps:lib_install" | ||
|
|
||
| - run: "task test:unit-test" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| version: "3" | ||
|
|
||
| tasks: | ||
| target: | ||
| internal: true | ||
| vars: | ||
| TARGET: "{{default \"all\" .TARGET}}" | ||
| requires: | ||
| vars: | ||
| - name: "TARGET" | ||
| enum: | ||
| - "all" | ||
| - "spider_client" | ||
| - "spider_worker" | ||
| - "spider_task_executor" | ||
| - "unitTest" | ||
| - "worker_test" | ||
|
kirkrodrigues marked this conversation as resolved.
Resolved
|
||
| deps: ["::config-cmake-project"] | ||
|
kirkrodrigues marked this conversation as resolved.
Resolved
|
||
| cmds: | ||
| - "cmake --build {{.G_BUILD_SPIDER_DIR}} --target {{.TARGET}} --parallel" | ||
|
kirkrodrigues marked this conversation as resolved.
Resolved
|
||
|
|
||
| clean: | ||
| internal: true | ||
| deps: ["::config-cmake-project"] | ||
|
sitaowang1998 marked this conversation as resolved.
Resolved
|
||
| cmds: | ||
| - "cmake --build {{.G_BUILD_SPIDER_DIR}} --target clean --parallel" | ||
|
kirkrodrigues marked this conversation as resolved.
Resolved
|
||
|
kirkrodrigues marked this conversation as resolved.
Resolved
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| version: "3" | ||
|
|
||
| includes: | ||
| build: "build-tasks.yaml" | ||
|
kirkrodrigues marked this conversation as resolved.
Resolved
|
||
|
|
||
| vars: | ||
| G_TEST_BINARY: "{{.G_BUILD_SPIDER_DIR}}/tests/unitTest" | ||
|
|
||
| tasks: | ||
| unit-test: | ||
|
kirkrodrigues marked this conversation as resolved.
Resolved
|
||
| cmds: | ||
| # Add build in cmds to serialize the build | ||
| - task: "build:target" | ||
| vars: {TARGET: "unitTest"} | ||
| - task: "build:target" | ||
| vars: {TARGET: "spider_task_executor"} | ||
| - task: "build:target" | ||
| vars: {TARGET: "worker_test"} | ||
|
kirkrodrigues marked this conversation as resolved.
Resolved
|
||
| # Tests tagged with storage requires mysql. Skip them for now. | ||
| - "{{.G_TEST_BINARY}} \"~[storage]\"" | ||
Uh oh!
There was an error while loading. Please reload this page.