Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Setup
description: Setup environment for CI

inputs:
targets:
description: Comma-separated list of target triples to install for this toolchain
required: false
components:
description: Comma-separated list of components to be additionally installed
required: false

runs:
using: 'composite'
steps:
- shell: bash
run: |
echo $HOME
echo ${{ runner.os }}

- name: Cache APT packages
if: runner.os == 'Linux'
uses: actions/cache@v4
with:
path: |
/var/cache/apt/archives
/var/lib/apt/lists
key: ${{ runner.os }}-apt-${{ hashFiles('.github/actions/setup/apt-packages.txt') }}
restore-keys: |
${{ runner.os }}-apt-

- name: Update and install APT packages
if: runner.os == 'Linux'
shell: bash
run: |
sudo apt-get update
xargs -a .github/actions/setup/apt-packages.txt sudo apt-get install -y

- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this always take the latest stable, or will this read what the project requests?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will use the latest stable version yes. The project requests a minimum version of 1.82, but I don't think it's enforcing any specific version newer than that

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think it might be better to lock to a specific version?

targets: ${{ inputs.targets }}
components: ${{ inputs.components }}

- uses: Swatinem/rust-cache@v2
with:
key: ${{ runner.os }}-${{ inputs.targets }}-rust-cache
1 change: 1 addition & 0 deletions .github/actions/setup/apt-packages.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
protobuf-compiler
41 changes: 41 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: CI

on:
pull_request:
push:
branches:
- main

env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1

concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

jobs:
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
with:
components: clippy
- run: cargo clippy

unit-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- run: cargo test

format-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
with:
components: rustfmt
- run: cargo fmt --all -- --check
Loading