Skip to content

Commit 1dface7

Browse files
authored
Merge pull request #55 from saviorand/chore/update-nightly-21-08-24
Bump to September 2024 nightly
2 parents e80c3b1 + d7869d1 commit 1dface7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+2708
-7479
lines changed

.github/workflows/branch.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Branch workflow
2+
3+
on:
4+
push:
5+
branches:
6+
- '*'
7+
pull_request:
8+
branches:
9+
- '*'
10+
11+
permissions:
12+
contents: write
13+
14+
jobs:
15+
test:
16+
uses: ./.github/workflows/test.yml
17+
18+
package:
19+
uses: ./.github/workflows/package.yml

.github/workflows/main.yml

Lines changed: 12 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,22 @@
1-
name: Main pipeline
1+
name: Main workflow
22

33
on:
44
push:
5-
branches:
6-
- main
5+
branches: [main]
76

87
permissions:
98
contents: write
109

1110
jobs:
12-
setup:
13-
name: Setup environment and install dependencies
14-
runs-on: ubuntu-latest
15-
steps:
16-
- name: Checkout code
17-
uses: actions/checkout@v2
18-
- name: Install modular
19-
run: |
20-
curl -s https://get.modular.com | sh -
21-
modular auth examples
22-
- name: Install Mojo
23-
run: modular install mojo
24-
- name: Add to PATH
25-
run: echo "/home/runner/.modular/pkg/packages.modular.com_mojo/bin" >> $GITHUB_PATH
2611
test:
27-
name: Run tests
28-
runs-on: ubuntu-latest
29-
needs: setup
30-
steps:
31-
- name: Run the test suite
32-
run: mojo run_tests.mojo
12+
uses: ./.github/workflows/test.yml
13+
3314
package:
34-
name: Create package
35-
runs-on: ubuntu-latest
36-
needs: setup
37-
steps:
38-
- name: Run the package command
39-
run: mojo package lightbug_http -o lightbug_http.mojopkg
40-
- name: Upload package to release
41-
uses: svenstaro/upload-release-action@v2
42-
with:
43-
file: lightbug_http.mojopkg
44-
tag: latest-build
45-
overwrite: true
15+
uses: ./.github/workflows/package.yml
16+
17+
publish:
18+
uses: ./.github/workflows/publish.yml
19+
secrets:
20+
PREFIX_API_KEY: ${{ secrets.PREFIX_API_KEY }}
21+
22+

.github/workflows/package.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Create package
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
package:
8+
name: Package
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout code
12+
uses: actions/checkout@v4
13+
- name: Run the package command
14+
run: |
15+
curl -ssL https://magic.modular.com | bash
16+
source $HOME/.bash_profile
17+
magic run mojo package lightbug_http -o lightbug_http.mojopkg
18+
19+
- name: Upload package as artifact
20+
uses: actions/upload-artifact@v4
21+
with:
22+
name: lightbug_http-package
23+
path: lightbug_http.mojopkg

.github/workflows/publish.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Build and publish
2+
3+
on:
4+
workflow_call:
5+
secrets:
6+
PREFIX_API_KEY:
7+
required: true
8+
9+
jobs:
10+
publish:
11+
name: Publish package
12+
strategy:
13+
matrix:
14+
include:
15+
- { target: linux-64, os: ubuntu-latest }
16+
- { target: osx-arm64, os: macos-14 }
17+
fail-fast: false
18+
runs-on: ${{ matrix.os }}
19+
timeout-minutes: 5
20+
defaults:
21+
run:
22+
shell: bash
23+
steps:
24+
- name: Checkout repo
25+
uses: actions/checkout@v4
26+
27+
- name: Build package for target platform
28+
env:
29+
TARGET_PLATFORM: ${{ matrix.target }}
30+
PREFIX_API_KEY: ${{ secrets.PREFIX_API_KEY }}
31+
CONDA_BLD_PATH: ${{ runner.workspace }}/.rattler
32+
run: |
33+
curl -ssL https://magic.modular.com | bash
34+
source $HOME/.bash_profile
35+
36+
# Temporary method to fetch the rattler binary.
37+
RATTLER_BINARY="rattler-build-aarch64-apple-darwin"
38+
if [[ $TARGET_PLATFORM == "linux-64" ]]; then RATTLER_BINARY="rattler-build-x86_64-unknown-linux-musl"; fi
39+
curl -SL --progress-bar https://github.com/prefix-dev/rattler-build/releases/latest/download/${RATTLER_BINARY} -o rattler-build
40+
chmod +x rattler-build
41+
42+
# Build and push
43+
magic run build --target-platform=$TARGET_PLATFORM
44+
magic run publish

.github/workflows/release.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Release tag pipeline
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
test:
14+
uses: ./.github/workflows/test.yml
15+
16+
package:
17+
uses: ./.github/workflows/package.yml
18+
19+
publish:
20+
uses: ./.github/workflows/publish.yml
21+
secrets:
22+
PREFIX_API_KEY: ${{ secrets.PREFIX_API_KEY }}
23+
24+
upload-to-release:
25+
name: Upload to release
26+
needs: package
27+
runs-on: ubuntu-latest
28+
steps:
29+
- name: Get the version
30+
id: get_version
31+
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
32+
33+
- name: Upload package to release
34+
uses: svenstaro/upload-release-action@v2
35+
with:
36+
file: lightbug_http.mojopkg
37+
tag: ${{ steps.get_version.outputs.VERSION }}
38+
overwrite: true

.github/workflows/test.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Run the testing suite
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
test:
8+
name: Run tests
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout code
12+
uses: actions/checkout@v4
13+
- name: Run the test suite
14+
run: |
15+
curl -ssL https://magic.modular.com | bash
16+
source $HOME/.bash_profile
17+
magic run mojo run_tests.mojo
18+

.gitignore

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
11
*.📦
2+
*.mojopkg
23
.DS_Store
34
.mojoenv
4-
install_id
5+
install_id
6+
7+
# pixi environments
8+
.pixi
9+
*.egg-info
10+
11+
# magic environments
12+
.magic
13+
14+
# Rattler
15+
output

.mojoenv.example

Lines changed: 0 additions & 1 deletion
This file was deleted.

.pre-commit-config.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v2.3.0
4+
hooks:
5+
- id: check-yaml
6+
- id: end-of-file-fixer
7+
- id: trailing-whitespace
8+
- repo: local
9+
hooks:
10+
- id: mojo-format
11+
name: mojo-format
12+
entry: magic run mojo format -l 120
13+
language: system
14+
files: '\.(mojo|🔥)$'
15+
stages: [commit]

0 commit comments

Comments
 (0)