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
56 changes: 56 additions & 0 deletions .github/workflows/run_tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
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: ["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/deb181c4-455c-4abe-a263-afcff49ccf67 | 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: Run tests
run: |
magic install
magic run mojo test tests -I .

- name: Run formating checks
run: |
magic install
magic run mojo format ./

2 changes: 1 addition & 1 deletion mojoproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package = "magic run format && magic run mojo package decimojo && cp decimojo.mo
p = "magic run package"

# tests
test = "magic run package && magic run mojo tests/*.mojo && magic run mojo test tests"
test = "magic run package && magic run mojo tests/*.mojo && magic run mojo test tests -I ."
t = "magic run test"

# before commit
Expand Down
Loading