Skip to content

Commit 02fdb6c

Browse files
fabcor-maxivmarcus-oscarsson
authored andcommitted
Clean GitHub Actions workflows
Always use the conda environment for better consistency. Do not install Python dependencies when formatting/linting JavaScript. GitHub: fixes mxcube#1165
1 parent 0f38a31 commit 02fdb6c

File tree

2 files changed

+11
-43
lines changed

2 files changed

+11
-43
lines changed

.github/workflows/build_and_test.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@ jobs:
3636
with:
3737
python-version: ${{ matrix.python-version }}
3838

39-
- name: Install LDAP dependencies
40-
run: sudo apt-get -y install libsasl2-dev libldap2-dev libssl-dev
41-
4239
- name: Set up Conda environment
4340
uses: mamba-org/setup-micromamba@v1
4441
with:

.github/workflows/ui.yml

Lines changed: 11 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ jobs:
1414
- name: Checkout
1515
uses: actions/checkout@v3
1616

17-
- name: Install LDAP dependencies
18-
run: sudo apt-get -y install libsasl2-dev libldap2-dev libssl-dev
19-
2017
- name: Set up Conda environment
2118
uses: mamba-org/setup-micromamba@v1
2219
with:
@@ -25,14 +22,6 @@ jobs:
2522
cache-environment: true
2623
post-cleanup: "all"
2724

28-
- name: Install MXCuBE
29-
run: pip install -e .
30-
31-
- name: Install pnpm
32-
uses: pnpm/action-setup@v2
33-
with:
34-
version: 8.x
35-
3625
- name: Cache UI dependencies
3726
uses: actions/cache@v3
3827
with:
@@ -43,10 +32,10 @@ jobs:
4332
restore-keys: ${{ runner.os }}-
4433

4534
- name: Install UI dependencies
46-
run: pnpm --prefix ui install
35+
run: "${MAMBA_EXE} run --name mxcubeweb pnpm --prefix ui install"
4736

4837
- name: Run Prettier
49-
run: pnpm --prefix ui prettier
38+
run: "${MAMBA_EXE} run --name mxcubeweb pnpm --prefix ui prettier"
5039

5140
lint:
5241
name: Lint
@@ -59,9 +48,6 @@ jobs:
5948
- name: Checkout
6049
uses: actions/checkout@v3
6150

62-
- name: Install LDAP dependencies
63-
run: sudo apt-get -y install libsasl2-dev libldap2-dev libssl-dev
64-
6551
- name: Set up Conda environment
6652
uses: mamba-org/setup-micromamba@v1
6753
with:
@@ -70,14 +56,6 @@ jobs:
7056
cache-environment: true
7157
post-cleanup: "all"
7258

73-
- name: Install MXCuBE
74-
run: pip install -e .
75-
76-
- name: Install pnpm
77-
uses: pnpm/action-setup@v2
78-
with:
79-
version: 8.x
80-
8159
- name: Cache UI dependencies
8260
uses: actions/cache@v3
8361
with:
@@ -88,10 +66,11 @@ jobs:
8866
restore-keys: ${{ runner.os }}-
8967

9068
- name: Install UI dependencies
91-
run: pnpm --prefix ui install
69+
run: "${MAMBA_EXE} run --name mxcubeweb pnpm --prefix ui install"
9270

9371
- name: Run ESLint
94-
run: pnpm --prefix ui eslint --max-warnings=0 # fail on warnings
72+
# fail on warnings
73+
run: "${MAMBA_EXE} run --name mxcubeweb pnpm --prefix ui eslint --max-warnings=0"
9574

9675
e2e:
9776
name: Test
@@ -120,9 +99,6 @@ jobs:
12099
- name: Checkout
121100
uses: actions/checkout@v3
122101

123-
- name: Install LDAP dependencies
124-
run: sudo apt-get -y install libsasl2-dev libldap2-dev libssl-dev
125-
126102
- name: Set up Conda environment
127103
uses: mamba-org/setup-micromamba@v1
128104
with:
@@ -132,12 +108,7 @@ jobs:
132108
post-cleanup: "all"
133109

134110
- name: Install MXCuBE
135-
run: pip install -e .
136-
137-
- name: Install pnpm
138-
uses: pnpm/action-setup@v2
139-
with:
140-
version: 8.x
111+
run: "${MAMBA_EXE} run --name mxcubeweb poetry install --only main"
141112

142113
- name: Cache UI dependencies
143114
uses: actions/cache@v3
@@ -149,20 +120,20 @@ jobs:
149120
restore-keys: ${{ runner.os }}-
150121

151122
- name: Install UI dependencies
152-
run: pnpm --prefix ui install
123+
run: "${MAMBA_EXE} run --name mxcubeweb pnpm --prefix ui install"
153124

154125
- name: Build UI
155-
run: pnpm --prefix ui build
126+
run: "${MAMBA_EXE} run --name mxcubeweb pnpm --prefix ui build"
156127
env:
157128
DISABLE_ESLINT_PLUGIN: true
158129

159130
- name: Start MXCuBE-Web server
160131
run: |
161-
mxcubeweb-server -r ./test/HardwareObjectsMockup.xml/ --static-folder $(pwd)/ui/build/ -L debug &
162-
pnpm --prefix ui exec wait-on http://127.0.0.1:8081
132+
${MAMBA_EXE} run --name mxcubeweb mxcubeweb-server -r ./test/HardwareObjectsMockup.xml/ --static-folder $(pwd)/ui/build/ -L debug &
133+
${MAMBA_EXE} run --name mxcubeweb pnpm --prefix ui exec wait-on http://127.0.0.1:8081
163134
164135
- name: Run Cypress
165-
run: pnpm --prefix ui e2e
136+
run: "${MAMBA_EXE} run --name mxcubeweb pnpm --prefix ui e2e"
166137

167138
- uses: actions/upload-artifact@v3
168139
if: failure()

0 commit comments

Comments
 (0)