-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Refactor GitHub workflows and add code coverage job (#120)
* Split GitHub Actions definitions per language * Add code coverage job for Rust crate * Trigger CI run * Fix Rust coverage job * Fix Rust coverage job, take 2 * Add badges to README * See if all statuses are reported this way * Revert "See if all statuses are reported this way" This reverts commit 02b9df5. * Add code coverage job for Go library * Add names to Rust jobs
- Loading branch information
Showing
10 changed files
with
201 additions
and
126 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: Go | ||
on: | ||
pull_request: | ||
paths: | ||
- go/** | ||
push: | ||
branches: | ||
- master | ||
|
||
permissions: | ||
contents: read | ||
|
||
concurrency: | ||
group: go-ci-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/setup-go@v3 | ||
with: | ||
# ci is set to go1.19 to match developer setups | ||
go-version: 1.19.2 | ||
- uses: actions/checkout@v3 | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version | ||
version: v1.50.0 | ||
working-directory: go | ||
|
||
test: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.19.2 | ||
- name: test | ||
working-directory: ./go | ||
run: make test | ||
|
||
coverage: | ||
name: Code Coverage | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.19.2 | ||
- name: Run coverage | ||
working-directory: ./go | ||
run: go test -race -coverprofile=coverage.txt -covermode=atomic | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
files: go/coverage.txt | ||
fail_ci_if_error: true | ||
|
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 was deleted.
Oops, something went wrong.
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,100 @@ | ||
name: Rust | ||
on: | ||
pull_request: | ||
paths: | ||
- rust/** | ||
push: | ||
branches: | ||
- master | ||
|
||
permissions: | ||
contents: read | ||
|
||
concurrency: | ||
group: rust-ci-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
clippy: | ||
name: Clippy | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
- name: Check formatting | ||
working-directory: ./rust | ||
run: cargo fmt -- --check | ||
|
||
- name: Clippy (host-functions + std) | ||
working-directory: ./rust | ||
run: cargo clippy --tests -- -D warnings | ||
|
||
- name: Clippy (no-std) | ||
working-directory: ./rust | ||
run: cargo clippy --tests --no-default-features -- -D warnings | ||
|
||
- name: Clippy (host functions only) | ||
working-directory: ./rust | ||
run: cargo clippy --tests --no-default-features --features host-functions -- -D warnings | ||
|
||
test: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
- name: Check all target in std | ||
working-directory: ./rust | ||
run: cargo check --all | ||
|
||
- name: Check all target in no_std | ||
working-directory: ./rust | ||
run: cargo check --no-default-features --all | ||
|
||
- name: Build all targets in std | ||
working-directory: ./rust | ||
run: cargo build --all --all-targets | ||
|
||
- name: Build all targets in no_std | ||
working-directory: ./rust | ||
run: cargo build --all --no-default-features | ||
|
||
- name: Run all tests with no-std | ||
working-directory: ./rust | ||
run: cargo test --all --no-default-features | ||
|
||
- name: Run all tests with std | ||
working-directory: ./rust | ||
run: cargo test --all | ||
|
||
- name: Check no_std compatibility | ||
run: cd rust/no-std-check/; make setup; make all | ||
|
||
coverage: | ||
name: Code Coverage | ||
runs-on: ubuntu-latest | ||
env: | ||
CARGO_TERM_COLOR: always | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
override: true | ||
- name: Install cargo-llvm-cov | ||
uses: taiki-e/install-action@cargo-llvm-cov | ||
- name: Install cargo-nextest | ||
uses: taiki-e/install-action@nextest | ||
- name: Generate code coverage | ||
working-directory: ./rust | ||
run: cargo llvm-cov nextest --all-features --lcov --output-path lcov.info | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
files: rust/lcov.info | ||
fail_ci_if_error: true |
This file was deleted.
Oops, something went wrong.
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,24 @@ | ||
name: TypeScript | ||
on: | ||
pull_request: | ||
paths: | ||
- js/** | ||
push: | ||
branches: | ||
- master | ||
|
||
permissions: | ||
contents: read | ||
|
||
concurrency: | ||
group: ts-ci-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: test | ||
working-directory: ./js | ||
run: yarn && yarn test |
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