Skip to content

Commit ea9be87

Browse files
authored
[test] Add workflows (#9)
1 parent 9867c77 commit ea9be87

File tree

2 files changed

+57
-1
lines changed

2 files changed

+57
-1
lines changed

.github/workflows/run_tests.yaml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: DeciMojo Unit Tests
2+
on:
3+
pull_request:
4+
workflow_dispatch:
5+
6+
permissions:
7+
contents: read
8+
pull-requests: read
9+
10+
jobs:
11+
testing-decimojo:
12+
name: with ${{ matrix.os }}
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
os: ["ubuntu-22.04"]
17+
18+
runs-on: ${{ matrix.os }}
19+
timeout-minutes: 30
20+
21+
defaults:
22+
run:
23+
shell: bash
24+
env:
25+
DEBIAN_FRONTEND: noninteractive
26+
27+
steps:
28+
- name: Checkout repo
29+
uses: actions/checkout@v4
30+
31+
- name: Install magic
32+
run: |
33+
curl -ssL https://magic.modular.com/deb181c4-455c-4abe-a263-afcff49ccf67 | bash
34+
35+
- name: Add path
36+
run: |
37+
echo "MODULAR_HOME=$HOME/.modular" >> $GITHUB_ENV
38+
echo "$HOME/.modular/bin" >> $GITHUB_PATH
39+
echo "$HOME/.modular/pkg/packages.modular.com_mojo/bin" >> $GITHUB_PATH
40+
41+
- name: Activate virtualenv
42+
run: |
43+
python3 -m venv $HOME/venv/
44+
. $HOME/venv/bin/activate
45+
echo PATH=$PATH >> $GITHUB_ENV
46+
47+
- name: Run tests
48+
run: |
49+
magic install
50+
magic run mojo test tests -I .
51+
52+
- name: Run formating checks
53+
run: |
54+
magic install
55+
magic run mojo format ./
56+

mojoproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ package = "magic run format && magic run mojo package decimojo && cp decimojo.mo
1717
p = "magic run package"
1818

1919
# tests
20-
test = "magic run package && magic run mojo tests/*.mojo && magic run mojo test tests"
20+
test = "magic run package && magic run mojo tests/*.mojo && magic run mojo test tests -I ."
2121
t = "magic run test"
2222

2323
# before commit

0 commit comments

Comments
 (0)