-
Notifications
You must be signed in to change notification settings - Fork 8
85 lines (82 loc) · 2.53 KB
/
ci-test.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: CI tests
on:
push:
env:
# ansible-test needs special directory structure.
# WORKDIR is a subdir of GITHUB_WORKSPACE
WORKDIR: work-dir/ansible_collections/scale_computing/hypercore
LANG: C.UTF-8
jobs:
mypy:
name: Type checks (mypy)
runs-on: [ubuntu-latest]
container: quay.io/justinc1_github/scale_ci_integ:8
defaults:
run:
working-directory: ${{ env.WORKDIR }}
steps:
- name: Check out code
uses: actions/checkout@v3
with:
path: ${{ env.WORKDIR }}
- run: echo GITHUB_WORKSPACE=$GITHUB_WORKSPACE
- run: echo WORKDIR=$WORKDIR
- run: echo PWD=$PWD
- name: Run mypy
run: mypy -p plugins
docs:
runs-on: [ubuntu-latest]
container: quay.io/justinc1_github/scale_ci_integ:8
defaults:
run:
working-directory: ${{ env.WORKDIR }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
path: ${{ env.WORKDIR }}
- run: apt install -y git make rsync
- run: make docs
env:
ANSIBLE_COLLECTIONS_PATH: $GITHUB_WORKSPACE/work-dir
- run: ls -al docs/build/html
- uses: actions/upload-artifact@v3
with:
name: docs-html
path: work-dir/ansible_collections/scale_computing/hypercore/docs/build/html
sanity-test:
runs-on: [ubuntu-latest]
container: quay.io/justinc1_github/scale_ci_integ:8
defaults:
run:
working-directory: ${{ env.WORKDIR }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
path: ${{ env.WORKDIR }}
# Same as "make sanity"
# TODO reuse Makefile
- run: black -t py38 --check --diff --color plugins tests/unit
- run: flake8 --exclude tests/output/
- run: ansible-test sanity --local --python 3.10
# We need to install collections used in examples,
# ansible-lint knows those files are playbooks.
- run: ansible-galaxy collection install community.crypto
- run: ansible-lint
units-test:
runs-on: [ubuntu-latest]
container: quay.io/justinc1_github/scale_ci_integ:8
defaults:
run:
working-directory: ${{ env.WORKDIR }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
path: ${{ env.WORKDIR }}
# Same as "make units"
# TODO reuse Makefile
- run: ansible-test units --local --python 3.10 --coverage
- run: ansible-test coverage html --requirements
- run: ansible-test coverage report --omit 'tests/*' --show-missing