@@ -2,7 +2,7 @@ name: Default pipeline
2
2
3
3
on :
4
4
push :
5
- branches :
5
+ branches : # all branches
6
6
- ' *'
7
7
workflow_dispatch :
8
8
pull_request :
12
12
permissions :
13
13
contents : write
14
14
15
- env :
16
- MODULAR_HOME : /home/runner/.modular
17
-
18
15
jobs :
19
16
setup :
20
17
name : Setup environment and install dependencies
21
18
runs-on : ubuntu-latest
22
19
steps :
23
20
- name : Checkout code
24
21
uses : actions/checkout@v4
25
-
26
- - name : Cache Magic installation
27
- uses : actions/cache@v3
28
- with :
29
- path : ${{ env.MODULAR_HOME }}
30
- key : ${{ runner.os }}-magic-${{ hashFiles('**/lockfiles') }}
31
-
32
- - name : Install Magic
33
- run : |
34
- if [ ! -d ${{ env.MODULAR_HOME }} ]; then
35
- curl -ssL https://magic.modular.com | bash
36
- fi
37
- echo "${{ env.MODULAR_HOME }}/pkg/magic/bin" >> $GITHUB_PATH
38
- echo "MODULAR_HOME=${{ env.MODULAR_HOME }}" >> $GITHUB_ENV
39
-
22
+
40
23
test :
41
24
name : Run tests
42
25
runs-on : ubuntu-latest
43
26
needs : setup
44
27
steps :
45
- - name : Checkout code
46
- uses : actions/checkout@v4
47
-
48
- - name : Restore Magic installation
49
- uses : actions/cache@v3
50
- with :
51
- path : ${{ env.MODULAR_HOME }}
52
- key : ${{ runner.os }}-magic-${{ hashFiles('**/lockfiles') }}
53
-
54
- - name : Setup Magic PATH
28
+ - name : Install Magic
55
29
run : |
56
- echo "${{ env.MODULAR_HOME }}/pkg/magic/bin" >> $GITHUB_PATH
57
- echo "MODULAR_HOME=${{ env.MODULAR_HOME }}" >> $GITHUB_ENV
58
-
30
+ curl -ssL https://magic.modular.com | bash
31
+ source $HOME/.bash_profile
59
32
- name : Run the test suite
60
- run : magic run mojo run_tests.mojo
33
+ run : mojo run_tests.mojo
61
34
62
35
package :
63
36
name : Create package
64
37
runs-on : ubuntu-latest
65
38
needs : setup
66
39
steps :
67
- - name : Checkout code
68
- uses : actions/checkout@v4
69
-
70
- - name : Restore Magic installation
71
- uses : actions/cache@v3
72
- with :
73
- path : ${{ env.MODULAR_HOME }}
74
- key : ${{ runner.os }}-magic-${{ hashFiles('**/lockfiles') }}
75
-
76
- - name : Setup Magic PATH
40
+ - name : Install Magic
77
41
run : |
78
- echo "${{ env.MODULAR_HOME }}/pkg/magic/bin" >> $GITHUB_PATH
79
- echo "MODULAR_HOME=${{ env.MODULAR_HOME }}" >> $GITHUB_ENV
80
-
42
+ curl -ssL https://magic.modular.com | bash
43
+ source $HOME/.bash_profile
81
44
- name : Run the package command
82
- run : magic run mojo package lightbug_http -o lightbug_http.mojopkg
83
-
45
+ run : mojo package lightbug_http -o lightbug_http.mojopkg
84
46
- name : Upload package to release
85
47
uses : svenstaro/upload-release-action@v2
86
48
with :
87
49
file : lightbug_http.mojopkg
88
50
tag : latest-build
89
- overwrite : true
51
+ overwrite : true
0 commit comments