Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
79 changes: 37 additions & 42 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,59 +6,54 @@ on:
pull_request:
branches: ["main"]

permissions:
contents: read

# A newer push to the same pull request supersedes this run; a branch's runs
# queue instead.
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

env:
CARGO_TERM_COLOR: always

jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
# The external-generator tests build their fixture generators for
# wasm32-wasip1 (tests/cli/external.rs).
targets: wasm32-wasip1
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose

# The same build and tests on the other platforms (core#9): paths, line
# endings and executable lookup are where they're expected to differ.
test_cross_platform:
name: Test (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- windows-latest
- macos-latest
- ubuntu-24.04-arm
steps:
- uses: actions/checkout@v7
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-wasip1
- uses: Swatinem/rust-cache@v2
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
# The toolchain matrix (stable, beta, nightly), the same build and tests on
# the other platforms (core#9: paths, line endings and executable lookup are
# where they're expected to differ), and a stable canary on ubuntu-26.04 that
# may fail without failing the run. The reusable workflow's own jobs set the
# runner, the timeouts and the pinned actions.
rust:
name: rust
permissions:
contents: read
uses: ComlineProject/.github/.github/workflows/rust-ci.yml@797d473553d7f2fc50895bb2573acb83ac63c7cb # main, no release tag yet
with:
# The external-generator tests build their fixture generators for
# wasm32-wasip1 (tests/cli/external.rs).
targets: wasm32-wasip1

# Stays a local job: the CI images have neither rustfmt nor clippy, which
# the reusable workflow doesn't run either. Pinned to the toolchain
# `rust-toolchain.toml` names.
lint:
name: Lint
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
with:
egress-policy: audit
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # v1
with:
toolchain: 1.99.1
components: rustfmt, clippy
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
- name: rustfmt
run: cargo fmt --check
- name: clippy
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Lint

on:
push:
branches: [main]
pull_request:

permissions:
contents: read

# Not `lint-...`: the reusable workflow's own group is that, and groups are
# case-insensitive, so the same name would make the call wait on itself.
concurrency:
group: ci-lint-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
lint:
name: lint
permissions:
contents: read
uses: ComlineProject/.github/.github/workflows/lint.yml@797d473553d7f2fc50895bb2573acb83ac63c7cb # main, no release tag yet
with:
renovate-config: renovate.json
72 changes: 49 additions & 23 deletions .github/workflows/reports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,71 +19,92 @@ permissions:
contents: read

concurrency:
group: reports-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

env:
CARGO_TERM_COLOR: always

jobs:
size:
name: size
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
timeout-minutes: 45
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable
- uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
with:
egress-policy: audit
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # v1
with:
toolchain: 1.99.1
targets: wasm32-wasip1
- uses: Swatinem/rust-cache@v2
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
- id: rustc
run: echo "version=$(rustc --version)" >> "$GITHUB_OUTPUT"
- name: Build
run: |
cargo build --locked --release
- uses: ComlineProject/observatory/.github/actions/report-size@v1
- uses: ComlineProject/observatory/.github/actions/report-size@8d21b1fbe68f8b639676153ce1a308eaafdcc6a7 # v1
with:
output: reports/cli.size.json
toolchain: ${{ steps.rustc.outputs.version }}
artifacts: |
cli/x86_64-linux-release=target/release/comline
- uses: actions/upload-artifact@v7
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: report-size
path: reports/cli.size.json
if-no-files-found: error

coverage:
name: coverage
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
timeout-minutes: 45
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable
- uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
with:
egress-policy: audit
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # v1
with:
toolchain: 1.99.1
targets: wasm32-wasip1
- uses: Swatinem/rust-cache@v2
- uses: ComlineProject/observatory/.github/actions/report-rust-coverage@v1
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
- uses: ComlineProject/observatory/.github/actions/report-rust-coverage@8d21b1fbe68f8b639676153ce1a308eaafdcc6a7 # v1
with:
output: reports/cli.coverage.json
args: --workspace
- uses: actions/upload-artifact@v7
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: report-coverage
path: reports/cli.coverage.json
if-no-files-found: error

compile:
name: compile time
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
timeout-minutes: 45
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable
- uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
with:
egress-policy: audit
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # v1
with:
toolchain: 1.99.1
targets: wasm32-wasip1
- uses: ComlineProject/observatory/.github/actions/report-rust-compile@v1
- uses: ComlineProject/observatory/.github/actions/report-rust-compile@8d21b1fbe68f8b639676153ce1a308eaafdcc6a7 # v1
with:
output: reports/cli.compile.json
args: --workspace --release
- uses: actions/upload-artifact@v7
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: report-compile
path: reports/cli.compile.json
Expand All @@ -93,19 +114,24 @@ jobs:
name: publish
needs: [size, coverage, compile]
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
timeout-minutes: 15
permissions:
contents: write
steps:
- uses: actions/checkout@v7
- uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
with:
egress-policy: audit
# The one checkout that keeps its credentials: publish-report pushes.
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- uses: actions/download-artifact@v8
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
pattern: report-*
path: reports
merge-multiple: true
- uses: ComlineProject/observatory/.github/actions/publish-report@v1
- uses: ComlineProject/observatory/.github/actions/publish-report@8d21b1fbe68f8b639676153ce1a308eaafdcc6a7 # v1
with:
reports: reports/cli.size.json reports/cli.coverage.json reports/cli.compile.json
readme: .github/reports-branch.md
4 changes: 4 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["github>ComlineProject/.github:renovate-config"]
}
2 changes: 2 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[toolchain]
channel = "1.99.1"
Loading