Skip to content

Commit

Permalink
Merge branch 'refs/heads/main' into frank/paseo-integration-tests
Browse files Browse the repository at this point in the history
# Conflicts:
#	Cargo.lock
#	Cargo.toml
  • Loading branch information
evilrobot-01 committed Jul 28, 2024
2 parents d116ab1 + e403ef4 commit b3ba358
Show file tree
Hide file tree
Showing 6 changed files with 133 additions and 161 deletions.
27 changes: 27 additions & 0 deletions .github/actions/init/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Initialize
description: This action initializes a runner for use in other actions.
inputs:
cache-key:
description: "The key to be used for the cache"

runs:
using: "composite"
steps:
- name: Setup Ubuntu dependencies
shell: bash
run: sudo apt update && sudo apt install -y protobuf-compiler

- name: Free up space on runner
shell: bash
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Rust Cache
uses: Swatinem/rust-cache@v2.7.3
with:
cache-on-failure: true
cache-all-crates: true
key: ${{ inputs.cache-key }}
32 changes: 0 additions & 32 deletions .github/templates/setup-worker/action.yaml

This file was deleted.

127 changes: 0 additions & 127 deletions .github/workflows/build.yml

This file was deleted.

89 changes: 89 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: ci

on:
push:
branches: [ main ]
pull_request:
types: [ opened, synchronize, reopened, ready_for_review ]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Check formatting
run: cargo +stable fmt --all -- --check

check:
needs: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: "./.github/actions/init"

- name: Check Build
run: |
cargo check --release --locked --features=runtime-benchmarks,try-runtime
clippy:
needs: lint
runs-on: ubuntu-latest
permissions:
checks: write
env:
SKIP_WASM_BUILD: 1
steps:
- uses: actions/checkout@v4

- uses: "./.github/actions/init"

- name: Annotate with Clippy warnings
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --release --locked --features=runtime-benchmarks

test:
needs: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: "./.github/actions/init"

- name: Run tests
run: cargo test --release --locked --workspace --features=runtime-benchmarks --exclude integration-tests

integration-tests:
needs: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: "./.github/actions/init"

- name: Run integration tests
run: cargo test --release --locked --package integration-tests

coverage:
needs: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: "./.github/actions/init"

- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov

- name: Generate code coverage
run: cargo llvm-cov --all-features --workspace --exclude integration-tests --lib --bins --codecov --output-path codecov.json

- name: Upload to codecov.io
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: codecov.json
fail_ci_if_error: true
5 changes: 3 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# https://docs.codecov.com/docs/common-recipe-list
coverage:
status:
project:
default:
target: auto
threshold: 0%
comment:
layout: " diff, flags, files"
behavior: default
require_changes: false
require_base: false
require_head: true
hide_project_coverage: false

0 comments on commit b3ba358

Please sign in to comment.