Skip to content

Commit 5135846

Browse files
committed
simplify ci workflow
1 parent f5eae33 commit 5135846

File tree

1 file changed

+11
-49
lines changed

1 file changed

+11
-49
lines changed

.github/workflows/main.yml

Lines changed: 11 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Default pipeline
22

33
on:
44
push:
5-
branches:
5+
branches: # all branches
66
- '*'
77
workflow_dispatch:
88
pull_request:
@@ -12,78 +12,40 @@ on:
1212
permissions:
1313
contents: write
1414

15-
env:
16-
MODULAR_HOME: /home/runner/.modular
17-
1815
jobs:
1916
setup:
2017
name: Setup environment and install dependencies
2118
runs-on: ubuntu-latest
2219
steps:
2320
- name: Checkout code
2421
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+
4023
test:
4124
name: Run tests
4225
runs-on: ubuntu-latest
4326
needs: setup
4427
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
5529
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
5932
- name: Run the test suite
60-
run: magic run mojo run_tests.mojo
33+
run: mojo run_tests.mojo
6134

6235
package:
6336
name: Create package
6437
runs-on: ubuntu-latest
6538
needs: setup
6639
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
7741
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
8144
- 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
8446
- name: Upload package to release
8547
uses: svenstaro/upload-release-action@v2
8648
with:
8749
file: lightbug_http.mojopkg
8850
tag: latest-build
89-
overwrite: true
51+
overwrite: true

0 commit comments

Comments
 (0)