Skip to content

Merge pull request #72 from dominikwilkowski/dep-update #159

Merge pull request #72 from dominikwilkowski/dep-update

Merge pull request #72 from dominikwilkowski/dep-update #159

Workflow file for this run

name: Testing
defaults:
run:
shell: bash
on:
push:
branches:
- 'released'
pull_request:
branches:
- 'released'
jobs:
# ---------------------------------| RUST |--------------------------------- #
# ***********
# RUST - linting
# ***********
lint-rust:
strategy:
matrix:
os:
- ubuntu-latest
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: ./rust
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt, clippy
args: --manifest-path ./rust/Cargo.toml
- name: Run Makefile
run: make
- name: Tree files
run: |
sudo apt-get -y install tree & which tree
tree -I "node_modules*|.git*"
- name: Check formatting
uses: actions-rs/cargo@v1
with:
command: fmt
args: --manifest-path ./rust/Cargo.toml -- --check
- name: Annotate commit with clippy warnings
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features --manifest-path ./rust/Cargo.toml
# disabled until https://github.com/actions-rs/audit-check/issues/194 is fixed
# - name: Security audit
# uses: actions-rs/audit-check@v1
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
# ***********
# RUST - testing
# ***********
test-rust:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
runs-on: ${{ matrix.os }}
env:
OS: ${{ matrix.OS }}
defaults:
run:
working-directory: ./rust
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: Instal dependencies and build nodejs files
run: cd ../nodejs && yarn && yarn build
- name: Run Makefile
run: make
- name: Run build
run: cargo build --release --verbose
- name: Run cargo tests
uses: actions-rs/cargo@v1
with:
command: test
args: --no-fail-fast --manifest-path ./rust/Cargo.toml -- --nocapture
# ---------------------------------| NODE |--------------------------------- #
# ***********
# NODEJS - testing
# ***********
test-nodejs:
strategy:
matrix:
node: [ 12, 14, 16, 18 ]
os:
- ubuntu-latest
- windows-latest
- macOS-latest
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: ./nodejs
steps:
- uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Node version
run: node --version
- name: npm version
run: npm --version
- name: Yarn version
run: yarn --version
- name: Yarn install dependencies
run: yarn install --frozen-lockfile
- name: Build files
run: yarn build
- name: Tree files
run: npx tree-cli -l 5 --ignore "node_modules/, .git/"
- name: Yarn test
run: yarn test
# -------------------------------| COVERAGE |------------------------------- #
# ***********
# COVERAGE - nodejs
# ***********
coverage-nodejs:
needs: test-nodejs
strategy:
matrix:
node: [16]
os:
- ubuntu-latest
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: ./nodejs
steps:
- uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Yarn install dependencies
run: yarn install --frozen-lockfile
- name: Build files
run: yarn build
- name: Produce Coverage
run: yarn jest --coverage
- name: Print last few lines of lcov.info
run: tail ./coverage/lcov.info
- name: Upload to coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./nodejs/coverage/lcov.info
flag-name: nodejs
parallel: true
base-path: ./nodejs
env:
NODE_COVERALLS_DEBUG: 1
# ***********
# COVERAGE - rust
# ***********
coverage-rust:
needs: test-rust
strategy:
matrix:
os:
- ubuntu-latest
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: ./rust
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: Instal dependencies and build nodejs files
run: cd ../nodejs && yarn && yarn build
- name: Run Makefile
run: make
- name: Install Rust
run: rustup toolchain install stable --component llvm-tools-preview
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Generate code coverage
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
- name: Print last few lines of lcov.info
run: tail ./lcov.info
- name: Upload to coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./rust/lcov.info
flag-name: rust
parallel: true
env:
NODE_COVERALLS_DEBUG: 1
# ***********
# COVERAGE - finalizing
# ***********
coverage-finish:
needs: [coverage-nodejs, coverage-rust]
strategy:
matrix:
os:
- ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
- name: Coveralls Parallel Build Finished
uses: coverallsapp/github-action@v1.1.0
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true
env:
NODE_COVERALLS_DEBUG: 1