Skip to content

Commit 5cb6c38

Browse files
authored
Move to GitHub Actions (#16)
1 parent 7d2295f commit 5cb6c38

File tree

7 files changed

+51
-108
lines changed

7 files changed

+51
-108
lines changed

.circleci/config.yml

-63
This file was deleted.

.github/workflows/test-pr.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Test
2+
3+
on: pull_request
4+
5+
env:
6+
INSTALL_EDM_VERSION: 3.2.1
7+
8+
jobs:
9+
10+
test-with-edm:
11+
strategy:
12+
matrix:
13+
os: [macos-latest, ubuntu-latest]
14+
runs-on: ${{ matrix.os }}
15+
env:
16+
# Set root directory, mainly for Windows, so that the EDM Python
17+
# environment lives in the same drive as the cloned source. Otherwise
18+
# 'pip install' raises an error while trying to compute
19+
# relative path between the site-packages and the source directory.
20+
EDM_ROOT_DIRECTORY: ${{ github.workspace }}/.edm
21+
steps:
22+
- uses: actions/checkout@v2
23+
with:
24+
submodules: 'true'
25+
- name: Setup EDM
26+
uses: enthought/setup-edm-action@v1
27+
with:
28+
edm-version: ${{ env.INSTALL_EDM_VERSION }}
29+
- name: Install test environment
30+
run: |
31+
edm --config ci/.edm.yaml install -y click
32+
edm run -- python ci/edm_driver.py install
33+
- name: Run tests
34+
run: edm run -- python ci/edm_driver.py test

ci/.edm.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
store_url: https://packages.enthought.com
2+
repositories:
3+
- enthought/free

ci/edm_driver.py

+14-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#
22
# Copyright (c) 2017, Enthought, Inc.
3-
# Copyright (c) 2019, John Wiggins
3+
# Copyright (c) 2019-2021 John Wiggins
44
# All rights reserved.
55
#
66
# This software is provided without warranty under the terms of the BSD
@@ -17,10 +17,13 @@
1717

1818
import click
1919

20-
dependencies = {
20+
DEPENDENCIES = {
2121
'cython',
2222
'numpy',
2323
}
24+
CONFIG_FILE = os.path.abspath(
25+
os.path.join(os.path.dirname(__file__), '.edm.yaml')
26+
)
2427

2528

2629
@click.group()
@@ -35,11 +38,11 @@ def install(runtime, environment):
3538
""" Install project and dependencies into a clean EDM environment.
3639
"""
3740
parameters = get_parameters(runtime, environment)
38-
parameters['packages'] = ' '.join(dependencies)
41+
parameters['packages'] = ' '.join(DEPENDENCIES)
3942
# edm commands to setup the development environment
4043
commands = [
41-
"edm environments create {environment} --force --version={runtime}",
42-
"edm install -y -e {environment} {packages}",
44+
"{edm} environments create {environment} --force --version={runtime}",
45+
"{edm} install -y -e {environment} {packages}",
4346
"edm run -e {environment} -- pip install cmake",
4447
"edm run -e {environment} -- pip install -e .",
4548
]
@@ -88,15 +91,19 @@ def cleanup(runtime, environment):
8891

8992
def get_parameters(runtime, environment):
9093
""" Set up parameters dictionary for format() substitution """
91-
parameters = {'runtime': runtime, 'environment': environment}
94+
parameters = {
95+
'runtime': runtime,
96+
'environment': environment,
97+
'edm': 'edm --config {}'.format(CONFIG_FILE),
98+
}
9299
if environment is None:
93100
parameters['environment'] = 'blend2d-{runtime}'.format(**parameters)
94101
return parameters
95102

96103

97104
def execute(commands, parameters):
98105
for command in commands:
99-
print "[EXECUTING]", command.format(**parameters)
106+
click.echo("[EXECUTING]" + command.format(**parameters))
100107
try:
101108
subprocess.check_call(command.format(**parameters).split())
102109
except subprocess.CalledProcessError:

ci/install-edm-linux.sh

-18
This file was deleted.

ci/install-environment.sh

-10
This file was deleted.

ci/run-tests.sh

-10
This file was deleted.

0 commit comments

Comments
 (0)