Document how to use Briefcase in CI
We should add a topic guide for how to incorporate Briefcase into a CI setup.
This includes:
- On a pull request, running:
- code style checks
- checking for errors in documentation
- running the test suite
- checking for release notes
- Tagging a new app release.
- Signing a released app.
- Publishing a new release.
This will, by necessity, be a very opinionated guide; I would currently expect it to reccomend:
- Github Actions for CI configuration
- towncrier for release notes
- flake8 (possibly mentioning black)
- sphinx for docs
- tox as a common point of testing configuration
- pytest to run test suites
Traveltips currently has an incomplete CI configuration, but can serve as a good "working example". Briefcase has a much more complete CI configuration.
As you probably remember, I incorporate Briefcase in my CI/CD process of Eddington for about a few months now, but I'm using CircleCI as my platform for that.
If anyone who works on this issue needs some reference, he/she can take a look here to see how I did it there.
is briefcase create runnable now on github action ?
There are problems with docker.
For now it fails on linux.
- Github action doesn't provide ubuntu 16.04 so you can't use
--no-docker(I'm not sure about it) - Github runner 18.04 provide an outdated version of docker (see #429)
- Github runner 20.04 fails for the following reason :
the input device is not a TTY(https://pipelines.actions.githubusercontent.com/ppe4ZSLak9UTOCP3VTfZBea8jfANvOikJ7KH4UBWg38usmFQSU/_apis/pipelines/1/runs/477/signedlogcontent/4?urlExpires=2020-06-28T17%3A52%3A59.8504242Z&urlSigningMethod=HMACV1&urlSignature=YKVqhxtQ6%2BOi7iPmhgJF%2FYM8sSlepBu04mpPz%2B4BcWM%3D) maybe a fix there (https://serverfault.com/questions/897847/what-does-the-input-device-is-not-a-tty-exactly-mean-in-docker-run-output). I have no knowledge on docker, I can't help on it, just report.
@jgirardet Not sure where you got the idea that Github Actions doesn't have an Ubuntu 16.04 environment - it's definitely on their official list
As for the "input device is not a TTY" error - I'm not sure what specifically caused that (and the log has expired); but that will almost certainly be because the console is asking for input. There's a --no-input flag to explicitly turn that off (and fall back to safe defaults).
@freakboy3742 ok sorry it's fine on 16.04 (how I missed it ?) but it's not working on ubuntu 20.04 even with `--no-input`` : https://pastebin.com/FyvENBip "input device is not a TTY" is 5 lines before the end of the log.
Concerning this I could "maybe" reproduce it locally. With pycharm you can run some commands outside a terminal (its called run configurations). If I create a configuration which runs python -m briefcase create --no-input. I have the same error.
Commenting the line 174 "--tty" of docker.py file seems to fix the error. I don't know what does --tty so I have no idea if it's a usable fix.
@jgirardet Interesting - it makes sense that would be failing; --tty is attempting to allocate a pseudo terminal to the docker container. The downside to removing --tty is that you won't see the output of the Docker container as it builds, which can be useful debugging detail.
Do you still see a failure if you comment out the --interactive instead? That flag attempts to connect stdin, which is the underlying problem (CI doesn't have an stdin); I wonder if enabling the tty, but disabling interactive would allow us to have the best of both worlds (visible logs, but able to work under CI)