Skip to content

Commit

Permalink
try fixing issue with npm test publish happening in gh action only
Browse files Browse the repository at this point in the history
  • Loading branch information
vemonet committed Mar 30, 2024
1 parent 888c734 commit b169e94
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
# '--target', 'x86_64-linux-android',

build_binaries:
name: Build binaries for ${{ matrix.target }}
name: 📦️ Build binaries for ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -239,7 +239,7 @@ jobs:
if: startsWith(github.ref, 'refs/tags/')

publish_crates:
name: 📦️ Publish crates to crates.io
name: 🦀 Publish nanopub crate to crates.io
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
Expand Down
14 changes: 4 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rustup update
- run: rustup component add clippy rustfmt
- run: rustup update && rustup component add clippy rustfmt
- run: cargo fmt -- --check
- run: cargo clippy --all --all-targets --all-features

Expand All @@ -24,9 +23,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
rustup update
cargo install cargo-tarpaulin
- run: rustup update && cargo install cargo-tarpaulin
- run: cargo build --all-features
- run: cargo test
env:
Expand All @@ -44,9 +41,7 @@ jobs:
registry-url: 'https://registry.npmjs.org'
cache: npm
cache-dependency-path: "./js/package.json"
- run: |
rustup update
cargo install wasm-pack
- run: rustup update && cargo install wasm-pack
- name: Run tests
run: ./scripts/test-js.sh

Expand All @@ -72,8 +67,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Generate code coverage
run: |
cargo tarpaulin -p nanopub --out xml --exclude-files lib/src/error.rs --verbose --timeout 120
run: cargo tarpaulin -p nanopub --out xml --exclude-files lib/src/error.rs --verbose --timeout 120

- name: Upload to codecov.io
uses: codecov/codecov-action@v4
Expand Down
2 changes: 1 addition & 1 deletion js/tests/nanopub.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const unsignedRdf = `@prefix : <http://purl.org/nanopub/temp/mynanopub#> .
a npx:ExampleNanopub .
}`

describe('Tests for the curies npm package', () => {
describe('Tests for the @nanopub/sign npm package', () => {
// NOTE: `await init()` only needed in browser environment

test('publish nanopub', async () => {
Expand Down
5 changes: 3 additions & 2 deletions lib/src/nanopub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use rsa::pkcs8::DecodePublicKey;
use rsa::{sha2::Digest, sha2::Sha256, Pkcs1v15Sign, RsaPublicKey};
use sophia::api::dataset::{Dataset, MutableDataset};
use sophia::api::ns::{rdf, xsd, Namespace};
use sophia::api::term::{matcher::Any, Term};
use sophia::api::term::{matcher::Any, SimpleTerm, Term};
use sophia::inmem::dataset::LightDataset;
use sophia::iri::{AsIriRef, Iri};
use std::collections::HashSet;
Expand Down Expand Up @@ -250,7 +250,8 @@ impl Nanopub {
self.dataset.insert(
self.info.ns.as_iri_ref(),
ns("dct").get("created")?,
datetime_str.as_str() * xsd::dateTime,
SimpleTerm::LiteralDatatype(datetime_str.into(), xsd::dateTime.iriref()),
// TODO: datetime_str.as_str() * xsd::dateTime,
Some(&self.info.pubinfo),
)?;
}
Expand Down

0 comments on commit b169e94

Please sign in to comment.