-
-
Notifications
You must be signed in to change notification settings - Fork 45
117 lines (109 loc) · 3.11 KB
/
main.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: Ambianic Edge CI
on:
push:
# branches: [ master ]
pull_request:
# branches: [ master ]
jobs:
formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run formatting check
run: |
python3 -m pip install -U pre-commit
pre-commit install
pre-commit run --all-files
- name: Show diff on failure
if: ${{ failure() }}
run: |
git diff
test_x86:
needs: [formatting]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run test script
env:
ARCH: "linux/amd64"
TAG_SUFFIX: "amd64"
run: |
pwd
ls -al
echo GITHUB_WORKSPACE=${GITHUB_WORKSPACE}
echo "ARCH=${ARCH}"
${GITHUB_WORKSPACE}/build/ci-test-job.sh
test_arm:
needs: [formatting]
runs-on: ubuntu-latest
timeout-minutes: 50
steps:
- uses: actions/checkout@v2
- name: Run test script
# timeout-minutes: 20
env:
ARCH: "linux/arm/v7"
TAG_SUFFIX: "arm32v7"
run: |
pwd
ls -al
echo GITHUB_WORKSPACE=${GITHUB_WORKSPACE}
echo "ARCH=${ARCH}"
${GITHUB_WORKSPACE}/build/ci-test-job.sh
push_release:
needs: [test_x86, test_arm]
# run this job only if its a push on the master(main) branch
# of the upstream ambianic repo.
if: github.repository_owner == 'ambianic' &&
github.event_name == 'push' &&
github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- name: Use Node.js
uses: actions/setup-node@v1
- name: Semantic Release
id: semrel
uses: cycjimmy/semantic-release-action@v2
with:
extra_plugins: |
@semantic-release/changelog
@semantic-release/git
@semantic-release/exec
branches: |
[
'master',
]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Log new release info
if: steps.semrel.outputs.new_release_published == 'true'
run: |
echo ${{ steps.semrel.outputs.new_release_version }}
echo ${{ steps.semrel.outputs.new_release_major_version }}
echo ${{ steps.semrel.outputs.new_release_minor_version }}
echo ${{ steps.semrel.outputs.new_release_patch_version }}
publish_docs:
needs: [push_release]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: 3
- name: Run doc build script
run: |
${GITHUB_WORKSPACE}/build/ci-docs-job.sh
- name: Deploy to github pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/dist