CI: Adds dependency caching

pull/348/head
Tpt 2 years ago committed by Thomas Tanon
parent d453721e8b
commit 54ce7410d2
  1. 26
      .github/workflows/artifacts.yml
  2. 36
      .github/workflows/tests.yml

@ -16,6 +16,8 @@ jobs:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
with: with:
submodules: true submodules: true
- run: rustup update
- uses: Swatinem/rust-cache@v2
- run: cargo build --release - run: cargo build --release
working-directory: ./server working-directory: ./server
- uses: actions/upload-artifact@v3 - uses: actions/upload-artifact@v3
@ -34,6 +36,7 @@ jobs:
with: with:
submodules: true submodules: true
- run: rustup update - run: rustup update
- uses: Swatinem/rust-cache@v2
- run: cargo build --release - run: cargo build --release
working-directory: ./server working-directory: ./server
- uses: actions/upload-artifact@v3 - uses: actions/upload-artifact@v3
@ -48,6 +51,7 @@ jobs:
with: with:
submodules: true submodules: true
- run: rustup update - run: rustup update
- uses: Swatinem/rust-cache@v2
- run: Remove-Item -LiteralPath "C:\msys64\" -Force -Recurse - run: Remove-Item -LiteralPath "C:\msys64\" -Force -Recurse
- run: cargo build --release - run: cargo build --release
working-directory: ./server working-directory: ./server
@ -62,6 +66,8 @@ jobs:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
with: with:
submodules: true submodules: true
- run: rustup update
- uses: Swatinem/rust-cache@v2
- run: sed 's/%arch%/x86_64/g' .github/workflows/manylinux_build.sh | sed 's/%for_each_version%//g' > .github/workflows/manylinux_build_script.sh - run: sed 's/%arch%/x86_64/g' .github/workflows/manylinux_build.sh | sed 's/%for_each_version%//g' > .github/workflows/manylinux_build_script.sh
- run: docker run -v "$(pwd)":/workdir --platform linux/x86_64 quay.io/pypa/manylinux2014_x86_64 /bin/bash /workdir/.github/workflows/manylinux_build_script.sh - run: docker run -v "$(pwd)":/workdir --platform linux/x86_64 quay.io/pypa/manylinux2014_x86_64 /bin/bash /workdir/.github/workflows/manylinux_build_script.sh
- uses: actions/upload-artifact@v3 - uses: actions/upload-artifact@v3
@ -79,10 +85,13 @@ jobs:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
with: with:
submodules: true submodules: true
- run: rustup update && rustup target add aarch64-apple-darwin
- uses: Swatinem/rust-cache@v2
- uses: actions/setup-python@v4 - uses: actions/setup-python@v4
with: with:
python-version: "3.10" python-version: "3.10"
- run: rustup update && rustup target add aarch64-apple-darwin cache: pip
cache-dependency-path: '**/requirements.dev.txt'
- run: pip install -r python/requirements.dev.txt - run: pip install -r python/requirements.dev.txt
- run: maturin build --release -m python/Cargo.toml - run: maturin build --release -m python/Cargo.toml
- run: pip install --no-index --find-links=target/wheels/ pyoxigraph - run: pip install --no-index --find-links=target/wheels/ pyoxigraph
@ -101,10 +110,13 @@ jobs:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
with: with:
submodules: true submodules: true
- run: rustup update
- uses: Swatinem/rust-cache@v2
- uses: actions/setup-python@v4 - uses: actions/setup-python@v4
with: with:
python-version: "3.10" python-version: "3.10"
- run: rustup update cache: pip
cache-dependency-path: '**/requirements.dev.txt'
- run: Remove-Item -LiteralPath "C:\msys64\" -Force -Recurse - run: Remove-Item -LiteralPath "C:\msys64\" -Force -Recurse
- run: pip install -r python/requirements.dev.txt - run: pip install -r python/requirements.dev.txt
- run: maturin build --release -m python/Cargo.toml - run: maturin build --release -m python/Cargo.toml
@ -122,8 +134,16 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
with:
submodules: true
- run: rustup update - run: rustup update
- run: cargo install wasm-pack - uses: Swatinem/rust-cache@v2
- run: cargo install wasm-pack || true
- uses: actions/setup-node@v3
with:
node-version: 16
cache: npm
cache-dependency-path: "js/package.json"
- run: npm run pack - run: npm run pack
working-directory: ./js working-directory: ./js
- uses: actions/upload-artifact@v3 - uses: actions/upload-artifact@v3

@ -5,7 +5,7 @@ on:
branches: branches:
- main - main
schedule: schedule:
- cron: "0 0 * * 0" - cron: "12 3 * * *"
concurrency: concurrency:
group: ${{ github.workflow }}-${{ github.ref }} group: ${{ github.workflow }}-${{ github.ref }}
@ -26,6 +26,7 @@ jobs:
with: with:
submodules: true submodules: true
- run: rustup update && rustup component add clippy - run: rustup update && rustup component add clippy
- uses: Swatinem/rust-cache@v2
- run: cargo clippy - run: cargo clippy
working-directory: ./lib/oxsdatatypes working-directory: ./lib/oxsdatatypes
- run: cargo clippy - run: cargo clippy
@ -42,7 +43,8 @@ jobs:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
with: with:
submodules: true submodules: true
- run: rustup override set 1.60.0 && rustup component add clippy - run: rustup update && rustup override set 1.60.0 && rustup component add clippy
- uses: Swatinem/rust-cache@v2
- run: cargo clippy -- -D warnings -D clippy::all - run: cargo clippy -- -D warnings -D clippy::all
working-directory: ./lib/oxsdatatypes working-directory: ./lib/oxsdatatypes
- run: cargo clippy -- -D warnings -D clippy::all - run: cargo clippy -- -D warnings -D clippy::all
@ -67,6 +69,7 @@ jobs:
with: with:
submodules: true submodules: true
- run: rustup update - run: rustup update
- uses: Swatinem/rust-cache@v2
- run: cargo test --all-features - run: cargo test --all-features
env: env:
RUST_BACKTRACE: 1 RUST_BACKTRACE: 1
@ -77,8 +80,9 @@ jobs:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
with: with:
submodules: true submodules: true
- run: rustup update && rustup toolchain install nightly - run: rustup update && rustup override set nightly
- run: cargo +nightly test --tests --target x86_64-unknown-linux-gnu --workspace --exclude pyoxigraph --exclude oxigraph_testsuite --exclude oxigraph_server - uses: Swatinem/rust-cache@v2
- run: cargo test --tests --target x86_64-unknown-linux-gnu --workspace --exclude pyoxigraph --exclude oxigraph_testsuite --exclude oxigraph_server
env: env:
RUST_BACKTRACE: 1 RUST_BACKTRACE: 1
RUSTFLAGS: -Z sanitizer=address RUSTFLAGS: -Z sanitizer=address
@ -90,6 +94,7 @@ jobs:
with: with:
submodules: true submodules: true
- run: rustup update - run: rustup update
- uses: Swatinem/rust-cache@v2
- run: Remove-Item -LiteralPath "C:\msys64\" -Force -Recurse - run: Remove-Item -LiteralPath "C:\msys64\" -Force -Recurse
- run: cargo test --all-features - run: cargo test --all-features
env: env:
@ -100,7 +105,13 @@ jobs:
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- run: rustup update - run: rustup update
- run: cargo install wasm-pack - uses: Swatinem/rust-cache@v2
- run: cargo install wasm-pack || true
- uses: actions/setup-node@v3
with:
node-version: 16
cache: npm
cache-dependency-path: "js/package.json"
- run: npm install - run: npm install
working-directory: ./js working-directory: ./js
- run: npm test - run: npm test
@ -113,14 +124,18 @@ jobs:
with: with:
submodules: true submodules: true
- run: rustup update - run: rustup update
- uses: Swatinem/rust-cache@v2
- uses: actions/setup-python@v4 - uses: actions/setup-python@v4
with: with:
python-version: "3.10" python-version: "3.10"
cache: pip
cache-dependency-path: '**/requirements.dev.txt'
- run: pip install -r python/requirements.dev.txt - run: pip install -r python/requirements.dev.txt
- run: python -m black --check --diff --color . - run: python -m black --check --diff --color .
working-directory: ./python working-directory: ./python
- run: maturin sdist -m python/Cargo.toml - run: maturin build -m python/Cargo.toml
- run: pip install target/wheels/*.tar.gz - run: pip install --no-index --find-links=target/wheels/ pyoxigraph
- run: rm -r target/wheels
- run: python -m unittest - run: python -m unittest
working-directory: ./python/tests working-directory: ./python/tests
- run: sphinx-build -M doctest . build - run: sphinx-build -M doctest . build
@ -141,11 +156,16 @@ jobs:
with: with:
submodules: true submodules: true
- run: rustup update - run: rustup update
- uses: Swatinem/rust-cache@v2
- uses: actions/setup-python@v4 - uses: actions/setup-python@v4
with: with:
python-version: "3.7" python-version: "3.7"
cache: pip
cache-dependency-path: '**/requirements.dev.txt'
- run: pip install -r python/requirements.dev.txt - run: pip install -r python/requirements.dev.txt
- run: pip install ./python - run: maturin build -m python/Cargo.toml
- run: pip install --no-index --find-links=target/wheels/ pyoxigraph
- run: rm -r target/wheels
- run: python -m unittest - run: python -m unittest
working-directory: ./python/tests working-directory: ./python/tests

Loading…
Cancel
Save