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
59 changes: 30 additions & 29 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,44 +4,45 @@ on:
push:
pull_request:

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:
build_and_test:
name: Rust project - stable
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rustup update stable && rustup default stable
- run: cargo build --verbose
- run: cargo test --verbose

# The same build and test on the other platforms (core#9). The Linux x86_64
# job above keeps its name; these are additional checks.
test:
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
- run: rustup update stable && rustup default stable
- uses: Swatinem/rust-cache@v2
- run: cargo build --verbose
- run: cargo test --verbose
# The toolchain matrix (stable, beta, nightly), the same build and tests on
# the other platforms (core#9: paths and line endings 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

# `comline-codegen` takes core's IR only, with no parser, so it (and so a
# generator binary) builds for WASI and the browser.
# generator binary) builds for WASI and the browser. In the wasm CI image
# (stable 1.99.1, which `rust-toolchain.toml` pins, and both wasm targets).
wasm:
name: comline-codegen - wasm
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
timeout-minutes: 20
container: ghcr.io/comlineproject/ci-wasm@sha256:badd6af13cee6c459c9284de8ef0ef4a1667ed7e35582f87d1afb08f3c30fd8f
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
- run: rustup update stable && rustup default stable
- run: rustup target add wasm32-wasip1 wasm32-unknown-unknown
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- run: cargo build --verbose -p comline-codegen --target wasm32-wasip1
- run: cargo build --verbose -p comline-codegen --target wasm32-unknown-unknown
# The Markdown renderer as a WASI module, which the CLI can run under
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: [master]
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
33 changes: 22 additions & 11 deletions .github/workflows/reports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,30 @@ 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:
coverage:
name: coverage
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
timeout-minutes: 45
steps:
- uses: actions/checkout@v7
- uses: Swatinem/rust-cache@v2
- uses: ComlineProject/observatory/.github/actions/report-rust-coverage@v1
- 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: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
- uses: ComlineProject/observatory/.github/actions/report-rust-coverage@8d21b1fbe68f8b639676153ce1a308eaafdcc6a7 # v1
with:
output: reports/generation.coverage.json
args: --workspace
- uses: actions/upload-artifact@v7
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: report-coverage
path: reports/generation.coverage.json
Expand All @@ -46,19 +52,24 @@ jobs:
name: publish
needs: [coverage]
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/generation.coverage.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