Skip to content
This repository was archived by the owner on May 15, 2025. It is now read-only.

chore: add support for separate module versioning to CI #1522

chore: add support for separate module versioning to CI

chore: add support for separate module versioning to CI #1522

Workflow file for this run

name: ci
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Terraform
uses: coder/coder/.github/actions/setup-tf@main
- name: Set up Bun
uses: oven-sh/setup-bun@v2
with:
# We're using the latest version of Bun for now, but it might be worth
# reconsidering. They've pushed breaking changes in patch releases
# that have broken our CI.
# Our PR where issues started to pop up: https://github.com/coder/modules/pull/383
# The Bun PR that broke things: https://github.com/oven-sh/bun/pull/16067
bun-version: latest
- name: Install dependencies
run: bun install
- name: Run tests
run: bun test
pretty:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Needed to get tags
- uses: coder/coder/.github/actions/setup-tf@main
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Setup
run: bun install
- name: Format
run: bun fmt:ci
- name: typos-action
uses: crate-ci/[email protected]
- name: Lint
run: bun lint
# Skip version checks if requested in commit message
- name: Check for version check skip flag
id: check-skip
shell: bash
run: |
if [[ "${{ contains(github.event.head_commit.message || '', '[skip-version-check]') }}" == "true" ]]; then
echo "Skipping version check as requested in commit message"
echo "skip=true" >> $GITHUB_OUTPUT
else
echo "skip=false" >> $GITHUB_OUTPUT
fi
# For pull requests: Display version info but don't enforce
- name: Show module version info (PR)
if: github.event_name == 'pull_request' && steps.check-skip.outputs.skip != 'true'
shell: bash
run: |
echo "📌 Checking module versions for changed modules (informational only)..."
./modules-version.sh
echo "ℹ️ This check is informational only. Remember to update versions with ./modules-version.sh if needed."
# For main branch: Enforce version checks
- name: Verify module versions (main branch)
if: github.event_name != 'pull_request' && steps.check-skip.outputs.skip != 'true'
shell: bash
run: |
echo "🔍 Verifying module versions match tags..."
./modules-version.sh --check