Skip to content

[2.x] Adapt structure visitors to Codama v2 #2456

[2.x] Adapt structure visitors to Codama v2

[2.x] Adapt structure visitors to Codama v2 #2456

Workflow file for this run

name: Main
on:
push:
branches: [main, '[0-9]+.x']
pull_request:
branches: [main, '[0-9]+.x']
concurrency:
group: main-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions:
contents: read
env:
# Among other things, opts out of Turborepo telemetry. See https://consoledonottrack.com/.
DO_NOT_TRACK: '1'
NODE_VERSION: 24
jobs:
lint:
name: Check styling
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Set up pnpm
uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
- name: Set up Node.js
uses: actions/setup-node@v7
with:
node-version: ${{ env.NODE_VERSION }}
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Compile JS and types
run: pnpm build
- name: Check linting
run: pnpm lint
tests:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Set up pnpm
uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
- name: Set up Node.js
uses: actions/setup-node@v7
with:
node-version: ${{ env.NODE_VERSION }}
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build and run tests
run: pnpm test
- name: Regenerate output from the pinned @codama/spec
run: pnpm generate
- name: Ensure working directory is clean
run: |
git status
test -z "$(git status --porcelain)"
release:
name: Release
needs: [lint, tests]
if: github.event_name == 'push'
permissions:
contents: write
pull-requests: write
id-token: write
uses: codama-idl/release-tools/.github/workflows/release.yml@v1
with:
release-version: 2.x
secrets: inherit
dependabot:
name: Dependabot
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' && github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'codama-idl/codama'
needs: [lint, tests]
permissions:
contents: write
pull-requests: write
steps:
- name: Fetch Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@25dd0e34f4fe68f24cc83900b1fe3fe149efef98 # v3.1.0
- name: Auto-approve the PR
if: steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type == 'version-update:semver-minor'
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Enable auto-merge
if: steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type == 'version-update:semver-minor'
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}