Skip to content

Abstract from Regex in pattern validator and add support for regex-lite #90

Abstract from Regex in pattern validator and add support for regex-lite

Abstract from Regex in pattern validator and add support for regex-lite #90

Workflow file for this run

# Based on https://github.com/rust-lang/regex/blob/9582040009820380a16819ca0d1ae262c7d454b0/.github/workflows/ci.yml
# and https://github.com/Keats/validator/blob/09efa7e78e6fbc853a6a56af6904a00e2e6632b8/.github/workflows/ci.yml
name: ci
on:
pull_request:
push:
branches:
- main
workflow_dispatch:
# When a new run is triggered by a commit while a run is already in progress,
# we want to cancel the in-progress run so as to not waste CI resources.
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
# The section is needed to drop write-all permissions that are granted on
# `schedule` event. By specifying any permission explicitly all others are set
# to none. By using the principle of least privilege the damage a compromised
# workflow can do (because of an injection or compromised third party tool or
# action) is restricted. Currently the worklow doesn't need any additional
# permission except for pulling the code. Adding labels to issues, commenting
# on pull-requests, etc. may need additional permissions:
#
# Syntax for this section:
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
#
# Reference for how to assign permissions on a job-by-job basis:
# https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
#
# Reference for available permissions that we can enable if needed:
# https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token
permissions:
# to fetch code (actions/checkout)
contents: read
jobs:
test:
name: Test
runs-on: ${{ matrix.os }}
env:
CARGO_TERM_COLOR: always
strategy:
fail-fast: false
matrix:
build: [pinned, stable, nightly]
include:
- build: pinned
os: ubuntu-20.04
rust: 1.69
- build: stable
os: ubuntu-20.04
rust: stable
- build: nightly
os: ubuntu-20.04
rust: nightly
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Rust
uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ matrix.rust }}
- name: Cache
uses: Swatinem/rust-cache@v2
with:
shared-key: "rust-${{ matrix.build }}-test"
- name: Build docs
run: cargo doc --all-features
- name: Run tests
run: cargo test --all-features
checks:
name: Checks
runs-on: ubuntu-20.04
env:
CARGO_TERM_COLOR: always
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Rust
uses: dtolnay/rust-toolchain@v1
with:
toolchain: nightly
components: rustfmt, clippy
- name: Install tools
uses: taiki-e/install-action@v2
with:
tool: cargo-deny,cargo-audit,cargo-udeps,cargo-pants
- name: Cache
uses: Swatinem/rust-cache@v2
with:
shared-key: "rust-checks"
- name: Run checks
run: |
cargo fmt --all -- --check
cargo clippy -- -D warnings
cargo deny check
rm -rf ~/.cargo/advisory-db
# cargo audit
cargo udeps
cargo pants --dev