Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added GitHub Actions CI #1455

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tdulcet
Copy link
Contributor

@tdulcet tdulcet commented Oct 25, 2018

Edit: This PR is now very outdated, but I would be happy to update it if there is ever interest in adding CI. Travis CI is no longer free, so we would need to use GitHub Actions CI instead.

This pull request was originally part of #1435.

@JoshData
Copy link
Member

Great.

Can you explain what's going on in some of the steps? It would be good to add some comments to the .travis.yml file. Also why the change to certbot?

@tdulcet
Copy link
Contributor Author

tdulcet commented Oct 25, 2018

Can you explain what's going on in some of the steps?

- sudo sed -i "s/^127.0.1.1.*/127.0.1.1\t$HOSTNAME.example.com\t$HOSTNAME/" /etc/hosts

Adds a hostname to the hosts file.

mailinabox/.travis.yml

Lines 14 to 15 in 4f64f51

- sudo apt-get -yqq update
- sudo apt-get -yqq dist-upgrade

Updates the apt package database and upgrades all currently installed packages. This is of course already done as part of the script, but doing it here significantly reduces the script runtime and makes sure Ubuntu and all the commands used by the script before it does the upgrade, are up to date.

- sudo rm -f /opt/jdk_switcher/jdk_switcher.sh

Fixes a temporary issue with Travis CI and SpamAssassin. See here: travis-ci/travis-ci#8906 (comment).

- sudo setup/start.sh

Runs the script.

mailinabox/.travis.yml

Lines 20 to 23 in 4f64f51

- curl -IkL "https://$HOSTNAME/"
- curl -IkL "https://$HOSTNAME/admin"
- curl -IkL "https://$HOSTNAME/mail/"
- curl -IkL "https://$HOSTNAME/cloud/"

Verifies that all the services are running by getting the HTTP headers. You can check for the 200 OK HTTP status code.

- bash -c 'shopt -s globstar; shellcheck -s bash **/*.sh || true'

Runs ShellCheck. See here. #1457 fixes most of the bugs that are found. This line allows contributors to verify that new bugs are not added in future commits.

You can see the output of all these commands in the log here.

It would be good to add some comments to the .travis.yml file.

I can add the above as comments the .travis.yml file, if you would like.

Also why the change to certbot?

I was having issues with the script hanging on the certbot command in Travis CI.

certbot register -n --register-unsafely-without-email --agree-tos --config-dir $STORAGE_ROOT/ssl/lets_encrypt

This change forces certbot to run non-interactively. See here.
apt_install duplicity python-pip python-virtualenv certbot python-certbot-nginx

This change makes sure that all the required python dependencies are installed.

@tdulcet
Copy link
Contributor Author

tdulcet commented Oct 26, 2018

@JoshData Comments added to the .travis.yml file in cfcf34b.

@tdulcet tdulcet force-pushed the continuous-integration branch 3 times, most recently from 4938a18 to 31fbca8 Compare July 30, 2019 07:04
@tdulcet tdulcet changed the title Added Travis CI. Part of #1435 Added Travis CI. Mar 2, 2021
@tdulcet tdulcet changed the title Added Travis CI. Added GitHub Actions CI Sep 16, 2023
@tdulcet tdulcet force-pushed the continuous-integration branch 5 times, most recently from 2de35d1 to 0e35484 Compare March 10, 2024 16:03
@tdulcet
Copy link
Contributor Author

tdulcet commented Apr 3, 2024

@JoshData - Now that Travis CI is no longer free, I updated this PR to use GitHub Actions CI and test on Ubuntu 22.04. I also added comments to the workflow file as requested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants