Skip to content

Install via toolchain.toml #16

Install via toolchain.toml

Install via toolchain.toml #16

Workflow file for this run

name: CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TARPAULIN_VERSION: '0.31.2'
jobs:
setup:
name: Setup Environment
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
# Tools are cached as a group. When one or more tools are updated, a new
# cache will be created.
- name: Cache Cargo Tools
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.rustup/toolchains/
key: ${{ runner.os }}-cargo-tools-${{ env.CARGO_TARPAULIN_VERSION }}-${{ hashFiles('**/toolchain.toml')}}
- name: Check cache hit/miss
run: |
if [ "${{ steps.cache-dependencies.outputs.cache-hit }}" == "true" ]; then
echo "Cache hit!";
else
echo "Cache miss!";
fi

Check failure on line 39 in .github/workflows/ci-workflow.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/ci-workflow.yml

Invalid workflow file

You have an error in your yaml syntax on line 39
- name: Install toolchain.toml tools
run: |
# Extract tools section from toolchain.toml
sed -n '/\[tools\]/,/^$/p' toolchain.toml | grep -v '\[tools\]' | while read -r line; do
TOOL_NAME=$(echo "$line" | awk -F'=' '{gsub(/ /, "", $1); print $1}')
TOOL_VERSION=$(echo "$line" | awk -F'=' '{gsub(/["'\'']/,"",$2); print $2}')
cargo install "$TOOL_NAME" --version "$TOOL_VERSION"
done
- name: Install Cargo dependencies
run: |
cargo install cargo-tarpaulin --version ${{ env.CARGO_TARPAULIN_VERSION }} || true
- name: Run cargo-fmt
run: cargo fmt --all --check
- name: Run cargo-clippy
run: cargo clippy
- name: Run cargo-tarpaulin
run: cargo tarpaulin --out Xml --timeout 180
- name: Upload Code coverage
uses: actions/upload-artifact@v4
with:
name: code-coverage-report
path: cobertura.xml