Skip to content

Commit 0e35484

Browse files
committed
Added GitHub Actions CI.
1 parent 18b8f9a commit 0e35484

File tree

3 files changed

+80
-0
lines changed

3 files changed

+80
-0
lines changed

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"

.github/workflows/ci.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
schedule:
7+
- cron: '0 0 * * 0'
8+
9+
jobs:
10+
Mail-in-a-Box:
11+
name: Mail-in-a-Box
12+
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
matrix:
16+
# Add Ubuntu 26.04 here when supported.
17+
os: [ubuntu-22.04]
18+
fail-fast: false
19+
env:
20+
NONINTERACTIVE: 1
21+
PUBLIC_IP: auto
22+
PUBLIC_IPV6: auto
23+
PRIMARY_HOSTNAME: auto
24+
SKIP_NETWORK_CHECKS: 1
25+
steps:
26+
- uses: actions/checkout@v4
27+
- name: Before Script
28+
run: |
29+
set -x
30+
cat /etc/hosts
31+
# Adds a hostname to the hosts file.
32+
sudo sed -i "/^127\.0\.0\.1/a 127.0.0.1\t$HOSTNAME.example.com\t$HOSTNAME" /etc/hosts
33+
- name: Script
34+
run: |
35+
set -x
36+
# Runs the script.
37+
sudo -E bash -e -o pipefail -- setup/start.sh
38+
# Verifies all the services are running by getting the HTTP headers.
39+
curl -sSIkL "https://$HOSTNAME/"
40+
curl -sSIkL "https://$HOSTNAME/admin"
41+
curl -sSIkL "https://$HOSTNAME/mail/"
42+
curl -sSIkL "https://$HOSTNAME/cloud/"
43+
# Runs the test suite. Uncomment these three lines once #777 is merged.
44+
# cd test
45+
# pip install -r requirements.txt
46+
# pytest
47+
48+
ShellCheck:
49+
name: ShellCheck
50+
51+
runs-on: ubuntu-latest
52+
steps:
53+
- uses: actions/checkout@v4
54+
- name: ShellCheck
55+
run: shopt -s globstar; shellcheck -o avoid-nullary-conditions,check-extra-masked-returns,check-set-e-suppressed,deprecate-which,quote-safe-variables,require-double-brackets -s bash **/*.sh tools/{dns,web}_update
56+
# Remove this line once all errors are fixed.
57+
continue-on-error: true
58+
59+
Ruff:
60+
name: Ruff
61+
62+
runs-on: ubuntu-latest
63+
steps:
64+
- uses: actions/checkout@v4
65+
- name: Install dependencies
66+
run: |
67+
python3 -m pip install --upgrade pip
68+
python3 -m pip install ruff
69+
- name: Script
70+
run: ruff check --output-format=github --select F,E4,E7,E9,W,UP,YTT,S,BLE,B,A,C4,T10,DJ,EM,EXE,ISC,ICN,G,PIE,PYI,Q003,Q004,RSE,RET,SLF,SLOT,SIM,TID,TCH,ARG,PGH,PL,TRY,FLY,PERF,FURB,LOG,RUF --ignore W191,PLR09,PLR1702,PLR2004,RUF001,RUF002,RUF003,RUF023 --target-version py310 --preview . --exclude tools/mail.py
71+
# Remove this line once all errors are fixed.
72+
continue-on-error: true

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
[![CI](https://github.com/mail-in-a-box/mailinabox/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/mail-in-a-box/mailinabox/actions/workflows/ci.yml)
2+
13
Mail-in-a-Box
24
=============
35

0 commit comments

Comments
 (0)