Skip to content

Commit

Permalink
Add (daily) CI tests on stable and nightly (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
mlange-42 authored Jan 12, 2025
1 parent ee3165c commit 3bb13ef
Show file tree
Hide file tree
Showing 4 changed files with 122 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: Publish

env:
MDBOOK_VERSION: v0.4.43
STDLIB_VERSION: max/v24.6.0

on:
push:
branches:
Expand Down Expand Up @@ -27,7 +31,9 @@ jobs:
source /home/runner/.bash_profile
- name: Clone stdlib
run: |
git clone https://github.com/modularml/mojo.git --depth=1
git clone https://github.com/modularml/mojo.git
cd mojo
git checkout ${{env.STDLIB_VERSION}}
- name: Install mojo and dependencies
run: |
source /home/runner/.bash_profile
Expand All @@ -46,7 +52,7 @@ jobs:
- name: Download mdBook
run: |
mkdir bin
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.43/mdbook-v0.4.43-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin
curl -sSL https://github.com/rust-lang/mdBook/releases/download/${{env.MDBOOK_VERSION}}/mdbook-${{env.MDBOOK_VERSION}}-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin
- name: Run mdBook
run: |
bin/mdbook build markdown --dest-dir ../public
Expand Down
56 changes: 56 additions & 0 deletions .github/workflows/test-nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Test stdlib nightly

env:
STDLIB_VERSION: nightly

on:
schedule:
- cron: "0 0 * * *"
push:
branches:
- main
pull_request:

jobs:
test_stdlib:
name: Test stdlib nightly
runs-on: ubuntu-latest
steps:
- name: Checkout Modo
uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: '1.23.x'
- name: Install dependencies
run: go get .

- name: Install magic CLI
run: |
curl -ssL https://magic.modular.com | bash
source /home/runner/.bash_profile
- name: Clone stdlib
run: |
git clone https://github.com/modularml/mojo.git
cd mojo
git checkout ${{env.STDLIB_VERSION}}
- name: Install mojo and dependencies
run: |
source /home/runner/.bash_profile
cd mojo
magic install --locked
- name: Generate JSON docs
run: |
source /home/runner/.bash_profile
cd mojo
magic run mojo doc -o ../stdlib.json stdlib/src
- name: Create Markdown
run: |
go run ./cmd/modo markdown -i stdlib.json --mdbook
- name: Archive Markdown artifacts
uses: actions/upload-artifact@v4
with:
name: markdown-nightly
path: markdown
56 changes: 56 additions & 0 deletions .github/workflows/test-stable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Test stdlib stable

env:
STDLIB_VERSION: max/v24.6.0

on:
schedule:
- cron: "0 0 * * *"
push:
branches:
- main
pull_request:

jobs:
test_stdlib:
name: Test stdlib stable
runs-on: ubuntu-latest
steps:
- name: Checkout Modo
uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: '1.23.x'
- name: Install dependencies
run: go get .

- name: Install magic CLI
run: |
curl -ssL https://magic.modular.com | bash
source /home/runner/.bash_profile
- name: Clone stdlib
run: |
git clone https://github.com/modularml/mojo.git
cd mojo
git checkout ${{env.STDLIB_VERSION}}
- name: Install mojo and dependencies
run: |
source /home/runner/.bash_profile
cd mojo
magic install --locked
- name: Generate JSON docs
run: |
source /home/runner/.bash_profile
cd mojo
magic run mojo doc -o ../stdlib.json stdlib/src
- name: Create Markdown
run: |
go run ./cmd/modo markdown -i stdlib.json --mdbook
- name: Archive Markdown artifacts
uses: actions/upload-artifact@v4
with:
name: markdown-stable
path: markdown
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Modo

[![Test status](https://img.shields.io/github/actions/workflow/status/mlange-42/modo/tests.yml?branch=main&label=Tests&logo=github)](https://github.com/mlange-42/modo/actions/workflows/tests.yml)
[![stable](https://img.shields.io/github/actions/workflow/status/mlange-42/modo/test-stable.yml?branch=main&label=stable&logo=github)](https://github.com/mlange-42/modo/actions/workflows/test-stable.yml)
[![nightly](https://img.shields.io/github/actions/workflow/status/mlange-42/modo/test-nightly.yml?branch=main&label=nightly&logo=github)](https://github.com/mlange-42/modo/actions/workflows/test-nightly.yml)
[![Go Report Card](https://goreportcard.com/badge/github.com/mlange-42/modo)](https://goreportcard.com/report/github.com/mlange-42/modo)
[![Go Reference](https://img.shields.io/badge/reference-%23007D9C?logo=go&logoColor=white&labelColor=gray)](https://pkg.go.dev/github.com/mlange-42/modo)
[![GitHub](https://img.shields.io/badge/github-repo-blue?logo=github)](https://github.com/mlange-42/modo)
Expand Down

0 comments on commit 3bb13ef

Please sign in to comment.