@@ -13,71 +13,15 @@ jobs:
13
13
pre-commit :
14
14
runs-on : ubuntu-latest
15
15
steps :
16
- # All of these steps are just setup
17
16
- uses : actions/checkout@v4
18
- - name : Setting MAMBA_PATH
19
- run : echo "MAMBA_PATH=$HOME/mamba" >> $GITHUB_ENV
20
- - name : Setting OPENWPM_MAMBA_PATH
21
- run : echo "OPENWPM_MAMBA_PATH=$MAMBA_PATH/envs/openwpm" >> $GITHUB_ENV
22
- # If the environment.yaml hasn't changed we just reuse the entire conda install
23
- - id : cache
24
- uses : actions/cache@v4
25
- env :
26
- cache-name : conda-cache
27
- with :
28
- path : ${{ env.MAMBA_PATH }}
29
- key : ${{ env.cache-name }}-${{ hashFiles('environment.yaml') }}
30
-
31
- - name : Install conda
32
- if : ${{ steps.cache.outputs.cache-hit != 'true' }}
33
- run : $GITHUB_WORKSPACE/scripts/install-mamba.sh
34
-
35
- - run : echo "$MAMBA_PATH/bin" >> $GITHUB_PATH
36
-
37
- - name : Install.sh (cache miss)
38
- if : ${{ steps.cache.outputs.cache-hit != 'true' }}
39
- run : $GITHUB_WORKSPACE/install.sh
40
- - name : Install.sh (cache hit)
41
- if : ${{ steps.cache.outputs.cache-hit == 'true' }}
42
- run : $GITHUB_WORKSPACE/install.sh --skip-create
43
- - run : echo "$OPENWPM_MAMBA_PATH/bin" >> $GITHUB_PATH
44
- # Now we have a working OpenWPM environment
45
-
17
+ - uses : ./.github/actions/setup
46
18
- run : pre-commit run --all
47
19
48
20
demo :
49
21
runs-on : ubuntu-latest
50
22
steps :
51
- # All of these steps are just setup
52
23
- uses : actions/checkout@v4
53
- - name : Setting MAMBA_PATH
54
- run : echo "MAMBA_PATH=$HOME/mamba" >> $GITHUB_ENV
55
- - name : Setting OPENWPM_MAMBA_PATH
56
- run : echo "OPENWPM_MAMBA_PATH=$MAMBA_PATH/envs/openwpm" >> $GITHUB_ENV
57
- # If the environment.yaml hasn't changed we just reuse the entire conda install
58
- - id : cache
59
- uses : actions/cache@v4
60
- env :
61
- cache-name : conda-cache
62
- with :
63
- path : ${{ env.MAMBA_PATH }}
64
- key : ${{ env.cache-name }}-${{ hashFiles('environment.yaml') }}
65
-
66
- - name : Install conda
67
- if : ${{ steps.cache.outputs.cache-hit != 'true' }}
68
- run : $GITHUB_WORKSPACE/scripts/install-mamba.sh
69
-
70
- - run : echo "$MAMBA_PATH/bin" >> $GITHUB_PATH
71
-
72
- - name : Install.sh (cache miss)
73
- if : ${{ steps.cache.outputs.cache-hit != 'true' }}
74
- run : $GITHUB_WORKSPACE/install.sh
75
- - name : Install.sh (cache hit)
76
- if : ${{ steps.cache.outputs.cache-hit == 'true' }}
77
- run : $GITHUB_WORKSPACE/install.sh --skip-create
78
- - run : echo "$OPENWPM_MAMBA_PATH/bin" >> $GITHUB_PATH
79
- # Now we have a working OpenWPM environment
80
-
24
+ - uses : ./.github/actions/setup
81
25
- run : python demo.py --headless
82
26
tests :
83
27
runs-on : ubuntu-latest
95
39
]
96
40
fail-fast : false
97
41
steps :
98
- # All of these steps are just setup, maybe we should wrap them in an action
99
42
- uses : actions/checkout@v4
100
- - name : Cache node modules
101
- uses : actions/cache@v4
102
- env :
103
- cache-name : cache-node-modules
104
- with :
105
- # npm cache files are stored in `~/.npm` on Linux/macOS
106
- path : ~/.npm
107
- key : ${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
108
- # Setting env variables that depend on $HOME
109
- - name : Setting MAMBA_PATH
110
- run : echo "MAMBA_PATH=$HOME/mamba" >> $GITHUB_ENV
111
- - name : Setting OPENWPM_MAMBA_PATH
112
- run : echo "OPENWPM_MAMBA_PATH=$MAMBA_PATH/envs/openwpm" >> $GITHUB_ENV
113
-
114
- # If the environment.yaml hasn't changed we just reuse the entire conda install
115
- - id : conda-cache
116
- uses : actions/cache@v4
117
- env :
118
- cache-name : conda-cache
119
- with :
120
- path : ${{ env.MAMBA_PATH }}
121
- key : ${{ env.cache-name }}-${{ hashFiles('environment.yaml') }}
122
-
123
- - name : Install conda
124
- if : ${{ steps.conda-cache.outputs.cache-hit != 'true' }}
125
- run : $GITHUB_WORKSPACE/scripts/install-mamba.sh
126
-
127
- - run : echo "$MAMBA_PATH/bin" >> $GITHUB_PATH
128
-
129
- - name : Install.sh (cache miss)
130
- if : ${{ steps.conda-cache.outputs.cache-hit != 'true' }}
131
- run : $GITHUB_WORKSPACE/install.sh
132
- - name : Install.sh (cache hit)
133
- if : ${{ steps.conda-cache.outputs.cache-hit == 'true' }}
134
- run : $GITHUB_WORKSPACE/install.sh --skip-create
135
-
136
- - run : echo "$OPENWPM_MAMBA_PATH/bin" >> $GITHUB_PATH
137
- # Now we have a working OpenWPM environment
138
-
43
+ - uses : ./.github/actions/setup
139
44
- run : ./scripts/ci.sh
140
45
env :
141
46
DISPLAY : " :99.0"
0 commit comments