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
9 changes: 7 additions & 2 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ concurrency:
group: pages
cancel-in-progress: true

env:
# Keep in step with test.yml's pin -- docs runs `mojo doc`, which compiles the
# sources and so breaks on the same stdlib changes the tests do.
MOJO_VERSION: "1.0.0b3.dev2026073014"

jobs:
build-deploy:
runs-on: ubuntu-latest
Expand All @@ -27,10 +32,10 @@ jobs:
- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Install Mojo nightly
- name: Install Mojo
run: |
uv venv
uv pip install mojo \
uv pip install "mojo==$MOJO_VERSION" \
--index https://whl.modular.com/nightly/simple/ \
--prerelease allow

Expand Down
60 changes: 56 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,46 @@ on:
push:
branches: [main]
pull_request:
# Weekly drift check against the latest nightly. Advisory only -- it runs on
# main, so a failure never blocks a PR; it tells us the language moved under a
# frozen repo. See the install step for how the two modes differ.
schedule:
- cron: "27 13 * * 1"
workflow_dispatch:

env:
# The nightly this repo is known to build and pass on. CI installs exactly
# this for pushes and PRs, so upstream churn cannot turn a green repo red
# without a commit. Bump it when the weekly drift check goes green on a newer
# one, or after fixing whatever it caught.
MOJO_VERSION: "1.0.0b3.dev2026073014"

jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 20
permissions:
contents: read
issues: write
steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Install Mojo nightly
- name: Install Mojo
run: |
uv venv
uv pip install mojo \
--index https://whl.modular.com/nightly/simple/ \
--prerelease allow
if [ "${{ github.event_name }}" = "schedule" ]; then
echo "::notice::Drift check: installing the LATEST nightly, ignoring the $MOJO_VERSION pin"
uv pip install mojo \
--index https://whl.modular.com/nightly/simple/ \
--prerelease allow
else
uv pip install "mojo==$MOJO_VERSION" \
--index https://whl.modular.com/nightly/simple/ \
--prerelease allow
fi
.venv/bin/mojo --version

- name: Format check
Expand All @@ -33,3 +56,32 @@ jobs:

- name: Unit tests — parse-error positions
run: .venv/bin/mojo run -I src test/test_errors.mojo

- name: Report nightly drift
if: failure() && github.event_name == 'schedule'
env:
GH_TOKEN: ${{ github.token }}
run: |
title="Mojo nightly drift: tests fail against the latest nightly"
installed=$(.venv/bin/mojo --version 2>/dev/null || echo "unknown")
# Heredoc, not a quoted string: a multi-line shell string would keep
# this block's indentation and markdown would render the body as code.
body=$(cat <<EOF
The weekly drift check failed against the latest Mojo nightly.

CI is pinned to $MOJO_VERSION and stays green, so no PR is blocked -- but
the latest nightly ($installed) no longer builds this repo.

Run: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID

Fix the breakage, then bump MOJO_VERSION in .github/workflows/test.yml
and .github/workflows/docs.yaml to the nightly that passes.
EOF
)
existing=$(gh issue list --repo "$GITHUB_REPOSITORY" --state open \
--search "$title in:title" --json number --jq '.[0].number // empty')
if [ -n "$existing" ]; then
gh issue comment "$existing" --repo "$GITHUB_REPOSITORY" --body "$body"
else
gh issue create --repo "$GITHUB_REPOSITORY" --title "$title" --body "$body"
fi
2 changes: 1 addition & 1 deletion test/test_errors.mojo
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def _assert_lc(source: String, offset: Int, line: Int, col: Int) raises:


def _msg(e: Error) -> String:
return String.write(e)
return String(e)


# --------------------------------------------------------------------------
Expand Down
Loading