Skip to content

optimize nested constant repetitions #377

optimize nested constant repetitions

optimize nested constant repetitions #377

Workflow file for this run

# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Test
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
rustfmt:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Format
run: cargo fmt --all -- --check
clippy:
needs: rustfmt
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: ⚡ Cache
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Setup Java
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: temurin
- name: Setup .NET
uses: actions/setup-dotnet@v4
if: ${{ matrix.os == 'ubuntu-latest' }}
with:
dotnet-version: '7.x.x'
- name: Setup Deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.x
- name: Cache
uses: Swatinem/rust-cache@v2
- name: Build and run tests
run: cargo test
coverage:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@nightly
- name: Setup Java
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: temurin
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '7.x.x'
- name: Setup Deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.x
- name: Setup grcov
env:
TAG: v0.8.19
run: |
mkdir -p ~/.local/bin
curl -sL https://github.com/mozilla/grcov/releases/download/$TAG/grcov-x86_64-unknown-linux-gnu.tar.bz2 | tar jxf - -C ~/.local/bin
echo ~/.local/bin >> $GITHUB_PATH
- name: Run grcov
env:
PROJECT_NAME: pomsky
RUSTFLAGS: '-Cinstrument-coverage -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Cinline-threshold=0 -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests'
RUSTDOCFLAGS: '-Cpanic=abort -Zpanic_abort_tests'
CARGO_INCREMENTAL: 0
run: |
rustup component add llvm-tools-preview
cargo test
grcov . -s . -t lcov --llvm --ignore-not-existing --ignore "/*" --ignore "pomsky-bin/src/test.rs" --ignore "target/*" -o lcov.info -b ./target/debug/pomsky
- name: Coveralls upload
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
files: 'lcov.info'