-
Notifications
You must be signed in to change notification settings - Fork 7
64 lines (58 loc) · 1.96 KB
/
continuous-integration-workflow.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Build and Test
# Workflow is triggered only on push to the master branch or a pull request to
# the master branch
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build-and-test:
runs-on: ubuntu-latest
container:
image: hoffmanlab/segway-test:latest
env:
SEGWAY_TEST_PYTHON_VERSION: 3
steps:
# Github actions runners do not have the same user permissions as jobs running in a container
# Git will ignore .git directories with different permissions:
# "fatal: detected dubious ownership in repository at '/github/workspace'"
# This is the current issue: https://github.com/actions/runner/issues/2033
# Can set 'options: --user 1001' on the container to match the UID of the Github runner, ref:
# https://github.com/actions/runner/blob/8415f13babf8199551f817eb16b718dcdd5b31e2/images/Dockerfile#L38
- uses: actions/checkout@v3
with:
fetch-depth: 0
# Fix ownership of the checkout dir
- name: Set ownership
run: |
chown -R $(id -u):$(id -g) $PWD
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install test dependencies
run: |
python3 -m pip install --upgrade pip setuptools build flake8 flake8-import-order flake8-quotes
- name: Build repository
run: |
python3 -m build
- name: Install
run: |
python3 -m pip install .
- name: Run tests
run: |
gmtkPrint -version
cd test && ./test_all.sh
- name: Capture test results on failure
if: ${{ failure () }}
uses: actions/upload-artifact@v2
with:
name: test-results
path: |
test/**/*-changes.tar.gz
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: segway-build
path: dist/*