forked from exaile/exaile
-
Notifications
You must be signed in to change notification settings - Fork 0
100 lines (94 loc) · 3.15 KB
/
ci.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
name: Exaile CI
on: [push, pull_request]
jobs:
lint:
timeout-minutes: 1
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: pip install black
- name: Check format
run: make check_format
test:
strategy:
matrix:
imgtag:
- debian-10
- debian-stable
- fedora-34
- fedora-latest
- ubuntu-18.04
- ubuntu-rolling
timeout-minutes: 4
runs-on: ubuntu-latest
container: ghcr.io/exaile/exaile-testimg:${{ matrix.imgtag }}
steps:
- uses: actions/checkout@v2
- name: Build and run tests
# Exaile has tests for file permissions that fail when run as root, so
# we de-escalate manually here.
# This requires the image to already have a user named `exaile`, created
# using e.g. `useradd -MN exaile`.
# The GST_REGISTRY_FORK=no works around <https://github.com/exaile/exaile/issues/783>
# until it's supposedly fixed in GLib 2.70.3.
run: |
chown -R exaile .
export HOME=/tmp/home
su -m exaile -c "GST_REGISTRY_FORK=no make BUILDDIR=/tmp/build test test_compile check-doc"
deploy:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
needs: [lint, test]
timeout-minutes: 2
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: sudo apt-get install -y --no-install-recommends python3-gi
- id: dist
name: Create source dist archive
run: |
version=${GITHUB_REF#refs/*/}
printf '::set-output name=version::%s\n' "${version}"
make DIST_VERSION="$version" dist
checksum=$(cd dist && sha256sum --tag *)
printf '::set-output name=checksum::%s\n' "${checksum}"
- name: Create GitHub release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
version='${{ steps.dist.outputs.version }}'
notes='```
${{ steps.dist.outputs.checksum }}
```'
gh release create \
"${version}" \
"dist/exaile-${version}.tar.gz" \
--draft \
--title "Exaile ${version}" \
--notes "${notes}"
notify:
if: always() && github.repository_owner == 'exaile'
needs: [lint, test, deploy]
timeout-minutes: 1
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: pip3 install pydle
- name: Send IRC notification
run: |
printf '%s | lint %s | test %s | deploy %s | %s' \
"${GITHUB_REF#refs/*/}" \
'${{ needs.lint.result }}' \
'${{ needs.test.result }}' \
'${{ needs.deploy.result }}' \
'http://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}' \
| python3 -m pydle.utils.irccat \
--port 6697 \
--tls --verify-tls \
--nickname 'exaile-ci' \
--channel '#exaile' \
chat.freenode.net