forked from exaile/exaile
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
84 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
name: Exaile CI | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
|
||
lint: | ||
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: | ||
- debian10-python3 | ||
- fedora31-python3 | ||
- ubuntu18.04-python3 | ||
- ubuntu19.10-python3 | ||
runs-on: ubuntu-latest | ||
container: exaile/exaile-testimg:${{ matrix.imgtag }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Build and run tests | ||
# The container always runs as root regardless of how we set it up in | ||
# the Dockerfile. Exaile has tests for file permissions that fail in | ||
# that setup, so we de-escalate manually here. | ||
run: | | ||
useradd -MN exaile | ||
chown -R exaile . | ||
export HOME=/tmp/home | ||
su -m exaile -c "make BUILDDIR=/tmp/build test test_compile check-doc" | ||
deploy: | ||
if: startsWith(github.ref, 'refs/tags/') | ||
needs: [lint, test] | ||
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: failure() && github.repository_owner == 'exaile' | ||
needs: [lint, test, deploy] | ||
runs-on: ubuntu-latest | ||
steps: | ||
# TODO: Make this send IRC message | ||
- name: Print status | ||
run: | | ||
printf "%s | lint %s | test %s | deploy %s\n" \ | ||
"${GITHUB_REF#refs/*/}" \ | ||
'${{ needs.lint.result }}' \ | ||
'${{ needs.test.result }}' \ | ||
'${{ needs.lint.result }}' |