Skip to content

Commit e585631

Browse files
actions: provision dependencies from conda-forge
* Install system dependencies from conda-forge rather than relying on the OS package manager. * This divorces us from the system environment / underlying OS image, isolating us from changes to it. * This gives us more flexibility in the versions of the systems we install (e.g. no need to change OS image to install an older/newer version of Python).
1 parent 34a9f54 commit e585631

File tree

2 files changed

+60
-61
lines changed

2 files changed

+60
-61
lines changed

.github/workflows/test_fast.yml

Lines changed: 34 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ concurrency:
1212
group: ${{ github.workflow }}-${{ github.ref }}
1313
cancel-in-progress: true
1414

15+
defaults:
16+
run:
17+
shell: bash -c "exec $CONDA_PREFIX/bin/bash -elo pipefail {0}"
18+
1519
jobs:
1620
test:
1721
runs-on: ${{ matrix.os }}
@@ -20,12 +24,10 @@ jobs:
2024
fail-fast: false # don't stop on first failure
2125
matrix:
2226
os: ['ubuntu-latest']
23-
python-version: ['3.8', '3.10', '3.11', '3']
27+
python-version: ['3.7', '3.8', '3.10', '3.11', '3.12', '3']
2428
include:
25-
- os: 'ubuntu-22.04'
26-
python-version: '3.7'
2729
- os: 'macos-latest'
28-
python-version: '3.9' # oldest supported version
30+
python-version: '3.8' # oldest version with arm64 builds
2931
# non-utc timezone test
3032
- os: 'ubuntu-latest'
3133
python-version: '3.9' # not the oldest, not the most recent version
@@ -39,24 +41,25 @@ jobs:
3941
- name: Checkout
4042
uses: actions/checkout@v4
4143

42-
- name: Configure Python
43-
uses: actions/setup-python@v5
44+
- name: Install System Dependencies
45+
uses: mamba-org/setup-micromamba@v2
4446
with:
45-
python-version: ${{ matrix.python-version }}
46-
47-
- name: Apt-Get Install
48-
if: startsWith(matrix.os, 'ubuntu')
47+
cache-environment: true
48+
post-cleanup: 'all'
49+
environment-name: cylc-fast-test
50+
create-args: >-
51+
python=${{ matrix.python-version }}
52+
pip
53+
bash
54+
sqlite
55+
56+
- name: Install Python Dependencies
4957
run: |
50-
sudo apt-get update
51-
sudo apt-get install -y sqlite3
58+
pip install -e ."[all]"
5259
5360
- name: Patch DNS
5461
uses: cylc/release-actions/patch-dns@v1
5562

56-
- name: Install
57-
run: |
58-
pip install -e ."[all]"
59-
6063
- name: Configure git # Needed by the odd test
6164
uses: cylc/release-actions/configure-git@v1
6265

@@ -99,21 +102,26 @@ jobs:
99102
lint:
100103
runs-on: 'ubuntu-latest'
101104
timeout-minutes: 10
105+
strategy:
106+
matrix:
107+
python-version: ['3']
102108
steps:
103-
- name: Apt-Get Install
104-
run: |
105-
sudo apt-get update
106-
sudo apt-get install -y shellcheck
107-
108109
- name: Checkout
109110
uses: actions/checkout@v4
110111

111-
- name: Configure Python
112-
uses: actions/setup-python@v5
112+
- name: Install System Dependencies
113+
uses: mamba-org/setup-micromamba@v2
113114
with:
114-
python-version: 3.x
115-
116-
- name: Install
115+
cache-environment: true
116+
post-cleanup: 'all'
117+
environment-name: cylc-lint-test
118+
create-args: >-
119+
python=${{ matrix.python-version }}
120+
pip
121+
bash
122+
shellcheck
123+
124+
- name: Install Python Dependencies
117125
run: |
118126
pip install -e ."[tests]"
119127

.github/workflows/test_functional.yml

Lines changed: 26 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ concurrency:
3232
group: ${{ github.workflow }}-${{ github.ref }}
3333
cancel-in-progress: true
3434

35+
defaults:
36+
run:
37+
shell: bash -c "exec $CONDA_PREFIX/bin/bash -elo pipefail {0}"
38+
3539
jobs:
3640
test:
3741
runs-on: ${{ matrix.os }}
@@ -56,34 +60,34 @@ jobs:
5660
platform: '_local_background*'
5761
# tests/k
5862
- name: 'flaky'
59-
os: 'ubuntu-22.04'
63+
os: 'ubuntu-latest'
6064
python-version: '3.7'
6165
test-base: 'tests/k'
6266
chunk: '1/1'
6367
platform: '_local_background* _local_at*'
6468
# remote platforms
6569
- name: '_remote_background_indep_poll'
66-
os: 'ubuntu-22.04'
70+
os: 'ubuntu-latest'
6771
python-version: '3.7'
6872
test-base: 'tests/f tests/k'
6973
chunk: '1/1'
7074
platform: '_remote_background_indep_poll _remote_at_indep_poll'
7175
- name: '_remote_background_indep_tcp'
72-
os: 'ubuntu-22.04'
76+
os: 'ubuntu-latest'
7377
test-base: 'tests/f tests/k'
7478
python-version: '3.7'
7579
chunk: '1/1'
7680
platform: '_remote_background_indep_tcp _remote_at_indep_tcp'
7781
# macos
7882
- name: 'macos 1/5'
7983
os: 'macos-latest'
80-
python-version: '3.9'
84+
python-version: '3.8' # oldest available
8185
test-base: 'tests/f'
8286
chunk: '1/5'
8387
platform: '_local_background*'
8488
- name: 'macos 2/5'
8589
os: 'macos-latest'
86-
python-version: '3.9'
90+
python-version: '3' # newest available
8791
test-base: 'tests/f'
8892
chunk: '2/5'
8993
platform: '_local_background*'
@@ -101,9 +105,20 @@ jobs:
101105
uses: actions/checkout@v4
102106

103107
- name: Configure Python
104-
uses: actions/setup-python@v5
108+
uses: mamba-org/setup-micromamba@v2
105109
with:
106-
python-version: ${{ matrix.python-version }}
110+
cache-environment: true
111+
post-cleanup: 'all'
112+
environment-name: cylc-functional-test
113+
create-args: >-
114+
python=${{ matrix.python-version }}
115+
pip
116+
bash
117+
coreutils
118+
sed
119+
grep
120+
tree
121+
sqlite
107122
108123
- name: Create global config
109124
run: |
@@ -128,36 +143,10 @@ jobs:
128143
__HERE__
129144
cat "$GLOBAL_CFG_PATH"
130145
131-
- name: Brew Install
132-
if: startsWith(matrix.os, 'macos')
133-
run: |
134-
# install system deps
135-
brew update
136-
brew install bash coreutils gnu-sed grep
137-
138-
# add GNU coreutils and sed to the user PATH
139-
# (see instructions in brew install output)
140-
echo "$(brew --prefix)/opt/coreutils/libexec/gnubin" >> "${GITHUB_PATH}"
141-
echo "$(brew --prefix)/opt/grep/libexec/gnubin" >> "${GITHUB_PATH}"
142-
echo "$(brew --prefix)/opt/gnu-sed/libexec/gnubin" >> "${GITHUB_PATH}"
143-
144-
# add coreutils to the bashrc too (for jobs)
145-
cat >> "${HOME}/.bashrc" <<__HERE__
146-
PATH="$(brew --prefix)/opt/coreutils/libexec/gnubin:$PATH"
147-
PATH="$(brew --prefix)/opt/grep/libexec/gnubin:$PATH"
148-
PATH="$(brew --prefix)/opt/gnu-sed/libexec/gnubin:$PATH"
149-
export PATH
150-
__HERE__
151-
152-
- name: Apt-Get Install
153-
if: startsWith(matrix.os, 'ubuntu')
154-
run: |
155-
sudo apt-get update
156-
sudo apt-get install -y sqlite3 tree at
157-
158146
- name: Add .github/bin/ to PATH
159147
# Sets up mocked mail command & any other custom executables
160-
run: echo "${{ github.workspace }}/.github/bin" >> $GITHUB_PATH
148+
# run: echo "${{ github.workspace }}/.github/bin" >> $GITHUB_PATH
149+
run: echo "export PATH=\"${{ github.workspace }}/.github/bin:$PATH\"" >> ~/.bashrc
161150

162151
- name: Install
163152
run: |
@@ -167,6 +156,8 @@ jobs:
167156
- name: Configure Atrun
168157
if: contains(matrix.platform, '_local_at')
169158
run: |
159+
sudo apt-get update
160+
sudo apt-get install -y at
170161
cat >> "$GLOBAL_CFG_PATH" << __HERE__
171162
[platforms]
172163
[[_local_at_indep_tcp]]

0 commit comments

Comments
 (0)