Skip to content

Infer repository URL from git info #4168

Infer repository URL from git info

Infer repository URL from git info #4168

Workflow file for this run

---
name: Test
on:
# Allow running this workflow manually from the Actions tab
workflow_dispatch:
pull_request:
push:
branches:
- main
# Run weekly on the default branch to make sure it always builds with the latest rust release
schedule:
- cron: '30 5 * * 1'
jobs:
rustfmt:
if: github.event_name != 'schedule'
runs-on: ubuntu-20.04
steps:
- name: Checkout the repo
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Install Rust nightly toolchain
run: rustup toolchain install --no-self-update nightly --profile minimal -c rustfmt
- name: Format check
run: cargo +nightly fmt --all -- --check
clippy:
if: github.event_name != 'schedule'
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, macos-14]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout the repo
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- if: ${{ runner.os == 'macOS' }}
name: Install protoc
run: brew install cmake protobuf
- if: ${{ runner.os == 'Linux' }}
name: Install protoc
run: sudo apt install -y protobuf-compiler
- name: Install Rust toolchain
run: rustup toolchain install --no-self-update stable --profile minimal -c clippy
- name: Clippy
run: cargo +stable clippy --locked --all-features --all-targets -- -D warnings
test-matrix:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, macos-14]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout the repo
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- if: ${{ runner.os == 'macOS' }}
name: Install protoc
run: brew install cmake protobuf
- if: ${{ runner.os == 'Linux' }}
name: Install protoc
run: sudo apt install -y protobuf-compiler
- name: Install Rust toolchain
run: rustup toolchain install --no-self-update stable --profile minimal
- name: Test
run: cargo +stable test --locked
oldstable:
strategy:
matrix:
os: [ubuntu-20.04, macos-14]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout the repo
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- if: ${{ runner.os == 'macOS' }}
name: Install protoc
run: brew install cmake protobuf
- if: ${{ runner.os == 'Linux' }}
name: Install protoc
run: sudo apt install -y protobuf-compiler
- name: Oldstable
run: |
oldstable=$(cat "./cli/Cargo.toml" | grep "rust-version" | sed 's/.*"\(.*\)".*/\1/')
rustup toolchain install --profile minimal "$oldstable"
cargo "+$oldstable" check
all-features:
# Skip this job when the secret is unavailable
if: github.secret_source == 'Actions'
strategy:
matrix:
os: [ubuntu-20.04, macos-14]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout the repo
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- if: ${{ runner.os == 'macOS' }}
name: Install protoc
run: brew install cmake protobuf
- if: ${{ runner.os == 'Linux' }}
name: Install protoc
run: sudo apt install -y protobuf-compiler
- name: Install Rust toolchain
run: rustup toolchain install --no-self-update stable --profile minimal
- name: All Features
env:
PHYLUM_API_KEY: ${{ secrets.PHYLUM_TOKEN_STAGING }}
run: cargo +stable test --all-features
deno-checks:
if: github.event_name != 'schedule'
runs-on: ubuntu-latest
container: denoland/deno
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: deno fmt
run: deno fmt --check
- name: deno lint
run: deno lint
- name: deno check
run: deno check --no-lock extensions/**/*.ts
shellcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Script Style Check
if: github.event_name != 'schedule'
run: shellcheck -o all -S style -s sh $(find . -iname "*.sh")
# This job reports the results of the matrixes above
test:
if: always()
needs: [clippy, test-matrix, all-features, oldstable]
runs-on: ubuntu-latest
steps:
- if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
name: Fail the build
run: exit 1