File tree 6 files changed +56
-15
lines changed
6 files changed +56
-15
lines changed Original file line number Diff line number Diff line change 7
7
paths :
8
8
- pyscriptjs/**
9
9
10
+ env :
11
+ MINICONDA_PYTHON_VERSION : py38
12
+ MINICONDA_VERSION : 4.11.0
13
+
14
+ defaults :
15
+ run :
16
+ working-directory : pyscriptjs
17
+
10
18
jobs :
11
19
build :
12
20
runs-on : ubuntu-latest
13
21
permissions :
14
22
contents : read
15
23
id-token : write
16
- defaults :
17
- run :
18
- working-directory : pyscriptjs
19
-
20
24
steps :
25
+
21
26
- name : Checkout
22
27
uses : actions/checkout@v3
28
+
23
29
- name : Install node
24
30
uses : actions/setup-node@v3
25
31
with :
26
32
node-version : 18.x
33
+
27
34
- name : Cache node modules
28
35
uses : actions/cache@v3
29
36
env :
30
37
cache-name : cache-node-modules
31
38
with :
32
- # npm cache files are stored in `~/.npm` on Linux/macOS
39
+ # npm cache files are stored in `~/.npm` on Linux/macOS
33
40
path : ~/.npm
34
41
key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
35
42
restore-keys : |
36
43
${{ runner.os }}-build-${{ env.cache-name }}-
37
44
${{ runner.os }}-build-
38
45
${{ runner.os }}-
46
+
47
+ - name : setup Miniconda
48
+ uses : conda-incubator/setup-miniconda@v2
49
+
39
50
- name : Install dependencies
40
51
run : |
41
52
npm install
53
+ make setup
54
+
55
+ - name : Test pyscript
56
+ run : make test
57
+
42
58
- name : Build pyscript
43
- run : |
44
- npm run build
59
+ run : make build
45
60
46
61
# Deploy to S3
47
62
- name : Configure AWS credentials
63
+ if : github.ref == 'refs/heads/main' # Only deploy on merge into main
48
64
uses : aws-actions/configure-aws-credentials@v1.6.1
49
65
with :
50
66
aws-region : ${{secrets.AWS_REGION}}
51
67
role-to-assume : ${{ secrets.AWS_OIDC_RUNNER_ROLE }}
68
+
52
69
- name : Sync to S3
70
+ if : github.ref == 'refs/heads/main'
53
71
run : aws s3 sync --quiet ./examples/build/ s3://pyscript.net/alpha/
Original file line number Diff line number Diff line change 15
15
- pyscriptjs/**
16
16
- .github/workflows/build-latest.yml # Test that workflow works when changed
17
17
18
+ env :
19
+ MINICONDA_PYTHON_VERSION : py38
20
+ MINICONDA_VERSION : 4.11.0
21
+
22
+ defaults :
23
+ run :
24
+ working-directory : pyscriptjs
25
+
18
26
jobs :
19
27
build :
20
28
runs-on : ubuntu-latest
21
29
permissions :
22
30
contents : read
23
31
id-token : write
24
- defaults :
25
- run :
26
- working-directory : pyscriptjs
27
-
28
32
steps :
33
+
29
34
- name : Checkout
30
35
uses : actions/checkout@v3
36
+
31
37
- name : Install node
32
38
uses : actions/setup-node@v3
33
39
with :
34
40
node-version : 18.x
41
+
35
42
- name : Cache node modules
36
43
uses : actions/cache@v3
37
44
env :
@@ -44,12 +51,20 @@ jobs:
44
51
${{ runner.os }}-build-${{ env.cache-name }}-
45
52
${{ runner.os }}-build-
46
53
${{ runner.os }}-
54
+
55
+ - name : setup Miniconda
56
+ uses : conda-incubator/setup-miniconda@v2
57
+
47
58
- name : Install dependencies
48
59
run : |
49
60
npm install
61
+ make setup
62
+
63
+ - name : Test pyscript
64
+ run : make test
65
+
50
66
- name : Build pyscript
51
- run : |
52
- npm run build
67
+ run : make build
53
68
54
69
# Deploy to S3
55
70
- name : Configure AWS credentials
58
73
with :
59
74
aws-region : ${{secrets.AWS_REGION}}
60
75
role-to-assume : ${{ secrets.AWS_OIDC_RUNNER_ROLE }}
76
+
61
77
- name : Sync to S3
62
78
if : github.ref == 'refs/heads/main'
63
79
run : aws s3 sync --quiet ./examples/build/ s3://pyscript.net/unstable
Original file line number Diff line number Diff line change 4
4
push :
5
5
branches :
6
6
- main
7
+ paths :
8
+ - docs/**
7
9
8
10
jobs :
9
11
build :
Original file line number Diff line number Diff line change 4
4
# Any time a tag or branch is created
5
5
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#create
6
6
create :
7
+ paths :
8
+ - docs/**
7
9
8
10
jobs :
9
11
build :
Original file line number Diff line number Diff line change 4
4
pull_request :
5
5
branches :
6
6
- ' *'
7
+ paths :
8
+ - docs/**
7
9
8
10
concurrency :
9
11
# Concurrency group that uses the workflow name and PR number if available
Original file line number Diff line number Diff line change @@ -6,14 +6,15 @@ src_dir ?= $(base_dir)/src
6
6
examples ?= $(base_dir ) /examples
7
7
app_dir ?= $(shell git rev-parse --show-prefix)
8
8
9
+ CONDA_EXE := conda
9
10
CONDA_ENV ?= ./env
10
11
env := $(CONDA_ENV )
11
- conda_run := conda run -p $(env )
12
+ conda_run := $( CONDA_EXE ) run -p $(env )
12
13
13
14
setup :
14
- @if [ -z " $$ {CONDA_SHLVL:+x}" ]; then echo " Conda is not installed." && exit 1; fi
15
15
$(CONDA_EXE ) env $(shell [ -d $(env ) ] && echo update || echo create) -p $(env ) --file environment.yml
16
16
$(conda_run ) playwright install
17
+ $(CONDA_EXE ) install -c anaconda pytest
17
18
18
19
clean :
19
20
find . -name \* .py[cod] -delete
You can’t perform that action at this time.
0 commit comments