[mojo] Update the code to accommodate with Mojo 25.3 #106
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: DeciMojo Unit Tests | |
on: | |
pull_request: | |
workflow_dispatch: | |
permissions: | |
contents: read | |
pull-requests: read | |
jobs: | |
testing-decimojo: | |
name: with ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
# os: ["macos-latest"] | |
os: ["ubuntu-22.04"] | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 30 | |
defaults: | |
run: | |
shell: bash | |
env: | |
DEBIAN_FRONTEND: noninteractive | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Install magic | |
run: | | |
curl -ssL https://magic.modular.com/ | MAGIC_VERSION=0.7.0 bash | |
- name: Add path | |
run: | | |
echo "MODULAR_HOME=$HOME/.modular" >> $GITHUB_ENV | |
echo "$HOME/.modular/bin" >> $GITHUB_PATH | |
echo "$HOME/.modular/pkg/packages.modular.com_mojo/bin" >> $GITHUB_PATH | |
- name: Activate virtualenv | |
run: | | |
python3 -m venv $HOME/venv/ | |
. $HOME/venv/bin/activate | |
echo PATH=$PATH >> $GITHUB_ENV | |
- name: Magic install | |
run: | | |
magic install | |
- name: Build package | |
run: | | |
magic run mojo package src/decimojo | |
magic run mojo package src/tomlmojo | |
cp decimojo.mojopkg tests/ | |
cp decimojo.mojopkg benches/ | |
mv tomlmojo.mojopkg tests/ | |
- name: Run tests | |
run: | | |
magic run mojo test tests | |
- name: Install pre-commit | |
run: | | |
pip install pre-commit | |
pre-commit install | |
- name: Run pre-commit | |
run: | | |
magic install | |
pre-commit run --all-files |