Skip to content

forgot a command

forgot a command #199

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@v4
- 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@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Setup Node
uses: actions/setup-node@v4
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:
os-node:
- os: ubuntu-latest
node: 12
- os: ubuntu-latest
node: 14
- os: ubuntu-latest
node: 16
- os: ubuntu-latest
node: 18
- os: ubuntu-latest
node: 20
- os: ubuntu-latest
node: 22
# - os: macOS-latest
# node: 12
# Not available for ARM
# - os: macOS-latest
# node: 14
# Not available for ARM
- os: macOS-latest
node: 16
- os: macOS-latest
node: 18
- os: macOS-latest
node: 20
- os: macOS-latest
node: 22
- os: windows-latest
node: 12
- os: windows-latest
node: 14
- os: windows-latest
node: 16
- os: windows-latest
node: 18
- os: windows-latest
node: 20
- os: windows-latest
node: 22
runs-on: ${{ matrix.os-node.os }}
steps:
- if: matrix.os-node.os == 'windows-latest'
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.os-node.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: cd nodejs && yarn install --frozen-lockfile
- name: Build files
run: cd nodejs && yarn build
- name: Tree files
run: npx tree-cli -l 5 --ignore "node_modules/, .git/"
- name: Yarn test
run: cd nodejs && 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@v4
- name: Setup Node
uses: actions/setup-node@v4
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@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Setup Node
uses: actions/setup-node@v4
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/[email protected]
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true
env:
NODE_COVERALLS_DEBUG: 1