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
33 changes: 33 additions & 0 deletions .github/workflows/actionlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: actionlint

# Reusable workflow: lints the caller's .github/workflows with a pinned, checksum-checked actionlint.
# The required check is named "<caller job id> / lint".

on:
workflow_call: {}

permissions: {}

jobs:
lint:
runs-on: ubuntu-24.04
timeout-minutes: 10
permissions:
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: actionlint
env:
ACTIONLINT_VERSION: 1.7.12
ACTIONLINT_SHA256: 8aca8db96f1b94770f1b0d72b6dddcb1ebb8123cb3712530b08cc387b349a3d8
run: |
set -euo pipefail
cd "$RUNNER_TEMP"
curl -fsSLo actionlint.tar.gz --retry 3 \
"https://github.com/rhysd/actionlint/releases/download/v${ACTIONLINT_VERSION}/actionlint_${ACTIONLINT_VERSION}_linux_amd64.tar.gz"
echo "${ACTIONLINT_SHA256} actionlint.tar.gz" | sha256sum -c -
tar -xzf actionlint.tar.gz actionlint
cd "$GITHUB_WORKSPACE"
"$RUNNER_TEMP/actionlint" -color
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

# The checks of this repository (AGENTS.md, Test).
on:
pull_request:
push:
branches: [main]

permissions: {}

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
workflows:
uses: ./.github/workflows/actionlint.yml
permissions:
contents: read

brand:
runs-on: ubuntu-24.04
timeout-minutes: 10
permissions:
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-node@8fccf151e3ba8038c300f83b40c8fd1e94f9c5ce # v7.2.0
with:
node-version: 22
package-manager-cache: false
- name: The brand files match their specs
run: |
set -euo pipefail
npm ci --prefix brand --ignore-scripts --no-audit --no-fund
npm run check --prefix brand
- name: The issue forms are valid YAML
run: |
ruby -ryaml -e 'Dir[".github/ISSUE_TEMPLATE/*.yml"].each { |f| YAML.load_file(f) }'
80 changes: 80 additions & 0 deletions .github/workflows/mule-extension.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: mule-extension

# Reusable workflow: builds and tests a tenavu connector (`mule-extension` packaging) with
# `mvn clean verify`. It needs no secret: every artifact comes from Maven Central and MuleSoft's
# public releases repository, and the tests run on the CE runtime, so a pull request from a fork
# gets the same run. Tests that need the EE runtime stay behind a Maven profile and do not run here.
# The required check is named "<caller job id> / verify".
#
# With check-contract-files, it first checks that the caller's copies of tenavu-contract files equal
# the commit it pins (the caller's scripts/contract-files.sh); the contract vectors themselves run in
# the build, as the caller's tests.

on:
workflow_call:
inputs:
check-contract-files:
description: Compare the caller's copies of tenavu-contract files with the pinned commit
type: boolean
default: false

permissions: {}

env:
# The hosted image's Maven is not pinned; mule-extensions-maven-plugin needs a 3.9 Maven.
MAVEN_VERSION: 3.9.11
MAVEN_SHA512: bcfe4fe305c962ace56ac7b5fc7a08b87d5abd8b7e89027ab251069faebee516b0ded8961445d6d91ec1985dfe30f8153268843c89aa392733d1a3ec956c9978
# Every mvn reads these (Maven 3.9 MAVEN_ARGS), the invoker's applications too: a slow or silent
# repository fails a request in minutes and is retried, instead of holding the job until its timeout.
MAVEN_ARGS: >-
-B -ntp
-Daether.connector.connectTimeout=30000
-Daether.connector.requestTimeout=120000
-Daether.connector.http.retryHandler.count=5

jobs:
verify:
runs-on: ubuntu-24.04
timeout-minutes: 30
permissions:
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Check out the contract
if: inputs.check-contract-files
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: tenavu/tenavu-contract
path: .tenavu-contract
# The pinned commit may be any commit of the contract.
fetch-depth: 0
persist-credentials: false
- name: The contract copies equal the pinned commit
if: inputs.check-contract-files
run: |
set -euo pipefail
mv .tenavu-contract "$RUNNER_TEMP/tenavu-contract"
# A commit that only a branch or pull request of the contract holds is not accepted.
commit="$(tr -d '[:space:]' < src/test/resources/contract/commit)"
git -C "$RUNNER_TEMP/tenavu-contract" merge-base --is-ancestor "$commit" origin/main ||
{ echo "::error::the pinned contract commit is not on tenavu-contract's main"; exit 1; }
scripts/contract-files.sh check "$RUNNER_TEMP/tenavu-contract"
- uses: actions/setup-java@d1374f8ac74474200d16ef8ecee22c7ae7a51880 # v6.3.0
with:
distribution: temurin
java-version: 17
cache: maven
- name: Maven ${{ env.MAVEN_VERSION }}
run: |
set -euo pipefail
archive="$RUNNER_TEMP/maven.tar.gz"
curl -fsSL --retry 3 --connect-timeout 30 --max-time 300 -o "$archive" \
"https://archive.apache.org/dist/maven/maven-3/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.tar.gz"
echo "${MAVEN_SHA512} ${archive}" | sha512sum -c -
mkdir -p "$RUNNER_TEMP/maven"
tar -xzf "$archive" -C "$RUNNER_TEMP/maven" --strip-components=1
echo "$RUNNER_TEMP/maven/bin" >>"$GITHUB_PATH"
- name: Build and test
run: mvn clean verify
33 changes: 33 additions & 0 deletions .github/workflows/openspec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: openspec

# Reusable workflow: validates every OpenSpec spec and change of the caller, strictly.
# The required check is named "<caller job id> / validate".

on:
workflow_call: {}

permissions: {}

jobs:
validate:
runs-on: ubuntu-24.04
timeout-minutes: 10
permissions:
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-node@8fccf151e3ba8038c300f83b40c8fd1e94f9c5ce # v7.2.0
with:
node-version: 22
package-manager-cache: false
- name: openspec validate
env:
OPENSPEC_VERSION: 1.14.1
OPENSPEC_TELEMETRY: "0"
# Only the CLI is pinned: it publishes no lockfile, and the job holds no secret.
run: |
set -euo pipefail
npm install --global --ignore-scripts --no-audit --no-fund "@fission-ai/openspec@${OPENSPEC_VERSION}"
openspec validate --all --strict --no-interactive
13 changes: 10 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ the organization, the brand assets and the organization profile.

## Technology

Stack: Markdown, GitHub community health files, JavaScript (Node 22, `brand/`), SVG
Stack: Markdown, GitHub community health files, GitHub Actions, JavaScript (Node 22, `brand/`), SVG
Standards: none
Delivery: A live
Integration branch: `main`
Expand All @@ -18,9 +18,14 @@ Article: none

- Build: `npm ci --prefix brand --ignore-scripts && npm run build --prefix brand` (needs Chrome)
- Test: `ruby -ryaml -e 'Dir[".github/ISSUE_TEMPLATE/*.yml"].each { |f| YAML.load_file(f) }'`;
every relative link in a Markdown file points at a file that exists; `npm run check --prefix brand`
every relative link in a Markdown file points at a file that exists; `npm run check --prefix brand`; `actionlint` on `.github/workflows/`. CI (`.github/workflows/ci.yml`)
runs `actionlint`, the brand check and the issue form check on every pull request
- Run locally: not applicable
- Deliver and verify: a merge into `main` is live. Check,
- Required checks on `main`: `brand`, `workflows / lint`. Renaming a job changes the ruleset
- Deliver and verify: a merge into `main` is live, except a `workflow_call` file, which reaches a
repository only when it re-pins. Before merging a change to one, get a green run of a caller branch
pinned to the new commit; after merging, re-pin each caller (`tenavu-log` calls all three,
`tenavu-contract` calls `actionlint.yml`) and check its run on `main`. For the rest, check,
for `tenavu-log` and `tenavu-contract`,
`gh api repos/tenavu/<repo>/community/profile` (contributing, code of conduct, templates) and
`gh api graphql -f query='{repository(owner:"tenavu",name:"<repo>"){isSecurityPolicyEnabled securityPolicyUrl}}'`,
Expand All @@ -31,6 +36,8 @@ Article: none
## Rules for this repository

- Repository text is in English.
- The workflows with `on: workflow_call` are called by the other tenavu repositories, pinned by
commit SHA: a change to an input or a job name changes every caller (and its required checks).
- The profile lists no install snippet before the first publication, and its product table and
the sentence under it are updated by hand when a status changes or a version is published (no
version column: it scrolls sideways on a phone).
Expand Down
4 changes: 4 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ By taking part you agree to the [Code of Conduct](https://github.com/tenavu/.git
numbers once releases are automated.
5. Sign off every commit (below).

CI runs on every pull request, with no secret. On your first contribution a maintainer has to
approve the run. A change under `.github/workflows/` can change what a check does, so a maintainer
reviews it line by line.

Write code, documentation, commits and messages in English. Never put real secrets, real
personal data or an employer's code or data in a commit, a test or an issue.

Expand Down
28 changes: 27 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# tenavu/.github

Community files, brand and organization profile of the
Community files, brand, organization profile and shared CI of the
[tenavu](https://github.com/tenavu) family of open-source Mule 4 connectors.

## What is here
Expand All @@ -11,12 +11,38 @@ Community files, brand and organization profile of the
| [`.github/ISSUE_TEMPLATE/`](.github/ISSUE_TEMPLATE), [`.github/pull_request_template.md`](.github/pull_request_template.md) | Issue forms and pull request template | Same default |
| [`brand/`](brand) | Logo, icons, banners and social images, built from specs | Uploaded by hand or linked; see its [README](brand/README.md) |
| [`profile/README.md`](profile/README.md) | Organization profile, written by hand | Shown on [github.com/tenavu](https://github.com/tenavu) |
| [`.github/workflows/`](.github/workflows) | Reusable CI workflows, and this repository's own `ci.yml` | Called by each repository; see [Reusable workflows](#reusable-workflows) |
| [`TRADEMARKS.md`](TRADEMARKS.md) | Use of the name and logos | Linked from `CONTRIBUTING.md`, `NOTICE` and the profile; not a GitHub default |

A repository overrides a default by adding its own file. Issue forms are all or nothing: any
file in a repository's own `.github/ISSUE_TEMPLATE/` replaces every default one. `LICENSE` is
never inherited: each repository carries its own.

## Reusable workflows

None takes a secret, by decision: a public repository holds no MuleSoft EE credential, tests run
on the CE runtime, and a pull request from a fork runs the same checks (after a maintainer approves
a first-time contributor's run). Call them from a job
under `on: pull_request` and `push` to `main`, pinned by the full commit SHA, with
`permissions: { contents: read }` on the job.

| Workflow | What it runs | Check name |
|---|---|---|
| [`mule-extension.yml`](.github/workflows/mule-extension.yml) | `mvn clean verify` on Java 17; with `check-contract-files: true`, first compares the `tenavu-contract` copies with the commit in `src/test/resources/contract/commit`, using the caller's `scripts/contract-files.sh`; that commit must be on the contract's `main` | `<job> / verify` |
| [`openspec.yml`](.github/workflows/openspec.yml) | `openspec validate --all --strict` | `<job> / validate` |
| [`actionlint.yml`](.github/workflows/actionlint.yml) | `actionlint` on the caller's workflows | `<job> / lint` |

```yaml
jobs:
build:
uses: tenavu/.github/.github/workflows/mule-extension.yml@<commit SHA> # main, <date>
permissions:
contents: read
```

A required check is named after the caller's job and the job above (`build / verify`); renaming
either changes the repository's ruleset too.

## License

[Apache-2.0](LICENSE), except the tenavu name, logos and the images and specs in `brand/` (see
Expand Down