-
Notifications
You must be signed in to change notification settings - Fork 2
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
ci: add workflows #34
Changes from all commits
f1f5e59
7666b76
95c05d8
6c8e65a
e1532be
16004da
db3c54c
1e2b109
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
--- | ||
name: Code test | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
format: | ||
name: Running formating checks | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install rust toolchain | ||
uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
with: | ||
toolchain: stable | ||
components: fmt | ||
|
||
- name: Run fmt checks | ||
run: | | ||
cargo fmt -- --check | ||
|
||
lint: | ||
name: Running lint checks | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install rust toolchain | ||
uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
with: | ||
toolchain: stable | ||
components: clippy | ||
|
||
- name: Run unit tests | ||
run: | | ||
cargo clippy -- -D warnings | ||
|
||
spell-check: | ||
name: Running spell check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20.9.0' | ||
|
||
- name: Install cspell | ||
run: npm install -g cspell | ||
|
||
- name: Spell check | ||
run: cspell "**/*" | ||
... |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
--- | ||
name: Code test | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
common-steps: | ||
name: common setup steps | ||
runs-on: ubuntu-latest | ||
outputs: | ||
rust-toolchain: ${{ steps.set-toolchain.outputs.version }} | ||
steps: | ||
- name: Stop existing Funnel container if running | ||
run: | | ||
docker stop $(docker ps -q --filter ancestor=ohsucompbio/funnel:latest) || true | ||
shell: bash | ||
|
||
- name: Start Funnel | ||
run: | | ||
docker run -d -p 8000:8000 ohsucompbio/funnel:latest \ | ||
server run --Server.HostName=localhost --Server.HTTPPort=8000 | ||
shell: bash | ||
|
||
- name: Wait for Funnel to be healthy | ||
run: | | ||
until curl --fail http://localhost:8000/v1/tasks; do | ||
echo "Waiting for Funnel to be healthy..." | ||
sleep 3 | ||
done | ||
shell: bash | ||
|
||
integration-tests: | ||
name: Run integration tests | ||
runs-on: ubuntu-latest | ||
needs: common-steps | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install rust toolchain | ||
uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
with: | ||
toolchain: stable | ||
|
||
- name: Run integration tests | ||
run: cargo test --tests | ||
|
||
- name: Install cargo-tarpaulin | ||
run: cargo install cargo-tarpaulin | ||
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. Add to 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. aah yes, didn't touch that as it wan't merged. 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. I think since it is a CLI tool it needs to be installed manually outside of the 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. Really? What's the difference? Aren't the deps in 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. @uniqueg deps in as for Adding a |
||
|
||
- name: Run unit tests with coverage | ||
run: cargo tarpaulin --tests --doc --out Xml | ||
|
||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v4 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
files: ./tarpaulin-report.xml | ||
flags: test_integration | ||
name: codecov-umbrella | ||
fail_ci_if_error: true | ||
verbose: true | ||
|
||
unit-tests: | ||
name: Run unit tests | ||
runs-on: ubuntu-latest | ||
needs: common-steps | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install rust toolchain | ||
uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
with: | ||
toolchain: stable | ||
|
||
- name: Run unit tests | ||
run: cargo test --lib | ||
|
||
- name: Install cargo-tarpaulin | ||
run: cargo install cargo-tarpaulin | ||
|
||
- name: Run unit tests with coverage | ||
run: cargo tarpaulin --tests --doc --out Xml | ||
|
||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
files: ./tarpaulin-report.xml | ||
flags: test_unit | ||
name: codecov-umbrella | ||
fail_ci_if_error: true | ||
verbose: true | ||
... |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Run linting?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
captions updated to the format "Running .... checks"