Skip to content

Commit aa74d07

Browse files
authored
Run tests using GitHub actions (#339)
* use GitHub actions for tests
1 parent 233acdd commit aa74d07

File tree

6 files changed

+119
-117
lines changed

6 files changed

+119
-117
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
<!-- add an 'x' in the brackets below -->
12
[] I have added an entry to `docs/changelog.md`
23

3-
<!-- provide evidence of testing, preferably with command(s) that can be copy+pasted by others -->
4+
## Summary of changes
45

56
## Test plan
7+
<!-- provide evidence of testing, preferably with command(s) that can be copy+pasted by others -->
68
Tested by running
79
```
810
# command(s) to exercise these changes
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Build native gdbgui executables
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
release:
9+
10+
jobs:
11+
build:
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
matrix:
15+
os: [ubuntu-latest, windows-latest, macos-latest]
16+
python-version: [3.8]
17+
include:
18+
- os: ubuntu-latest
19+
buildname: linux
20+
- os: windows-latest
21+
buildname: windows
22+
- os: macos-latest
23+
buildname: mac
24+
steps:
25+
- uses: actions/checkout@v1
26+
- name: Set up Python ${{ matrix.python-version }}
27+
uses: actions/setup-python@v2
28+
with:
29+
python-version: ${{ matrix.python-version }}
30+
- name: Install dependencies
31+
run: |
32+
python -m pip install --upgrade pip
33+
python -m pip install nox
34+
- name: Compile ${{ matrix.buildname }} gdbgui executable
35+
run: |
36+
nox --non-interactive --session build_executable_${{ matrix.buildname }}
37+
- name: Upload ${{ matrix.buildname }} executable
38+
if: github.ref == 'refs/heads/master'
39+
uses: actions/upload-artifact@v1
40+
with:
41+
name: gdbgui_${{ matrix.buildname }}
42+
path: ./executable/${{ matrix.buildname }}

.github/workflows/release.yml

Lines changed: 0 additions & 70 deletions
This file was deleted.

.github/workflows/tests.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions
2+
3+
name: CI tests
4+
5+
on:
6+
pull_request:
7+
push:
8+
branches:
9+
- master
10+
release:
11+
12+
jobs:
13+
run_tests:
14+
runs-on: ${{ matrix.os }}
15+
strategy:
16+
matrix:
17+
os: [ubuntu-latest]
18+
python-version: [3.6, 3.7, 3.8]
19+
20+
steps:
21+
- uses: actions/checkout@v2
22+
- name: Set up Python ${{ matrix.python-version }}
23+
uses: actions/setup-python@v2
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
pip install nox
30+
- name: Install gdb ubuntu
31+
run: |
32+
sudo apt-get install gdb
33+
- name: Execute Tests
34+
run: |
35+
nox --non-interactive --session tests-${{ matrix.python-version }}
36+
37+
lint:
38+
runs-on: ubuntu-latest
39+
steps:
40+
- uses: actions/checkout@v2
41+
- name: Set up Python
42+
uses: actions/setup-python@v2
43+
with:
44+
python-version: 3.8
45+
- name: Install dependencies
46+
run: |
47+
python -m pip install --upgrade pip
48+
pip install nox
49+
- name: Lint
50+
run: |
51+
nox --non-interactive --session lint
52+
53+
docs:
54+
runs-on: ubuntu-latest
55+
steps:
56+
- uses: actions/checkout@v2
57+
- name: Set up Python
58+
uses: actions/setup-python@v2
59+
with:
60+
python-version: 3.8
61+
- name: Install dependencies
62+
run: |
63+
python -m pip install --upgrade pip
64+
pip install nox
65+
- name: Verify Docs
66+
run: |
67+
nox --non-interactive --session docs

.travis.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

noxfile.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def cover(session):
4040
session.run("coverage", "erase")
4141

4242

43-
@nox.session(python="3.7")
43+
@nox.session
4444
def lint(session):
4545
session.run(
4646
"npx",
@@ -63,7 +63,7 @@ def lint(session):
6363
session.run("python", "setup.py", "check", "--metadata", "--strict")
6464

6565

66-
@nox.session(python="3.7")
66+
@nox.session
6767
def autoformat(session):
6868
session.install("black")
6969
session.run("black", *files_to_lint)
@@ -78,7 +78,7 @@ def autoformat(session):
7878
)
7979

8080

81-
@nox.session(python="3.7")
81+
@nox.session
8282
def docs(session):
8383
session.install(*doc_dependencies)
8484
session.run("mkdocs", "build")
@@ -93,6 +93,7 @@ def develop(session):
9393
session.log("To use, run: '%s'", command)
9494

9595

96+
@nox.session
9697
def build(session):
9798
session.install("setuptools", "wheel", "twine")
9899
session.run("rm", "-rf", "dist", external=True)
@@ -101,20 +102,20 @@ def build(session):
101102
session.run("twine", "check", "dist/*")
102103

103104

104-
@nox.session(python="3.7")
105+
@nox.session
105106
def publish(session):
106107
build(session)
107108
print("REMINDER: Has the changelog been updated?")
108109
session.run("python", "-m", "twine", "upload", "dist/*")
109110

110111

111-
@nox.session(python="3.7")
112+
@nox.session
112113
def watch_docs(session):
113114
session.install(*doc_dependencies)
114115
session.run("mkdocs", "serve")
115116

116117

117-
@nox.session(python="3.7")
118+
@nox.session
118119
def publish_docs(session):
119120
session.install(*doc_dependencies)
120121
session.run("mkdocs", "gh-deploy")

0 commit comments

Comments
 (0)