Skip to content

Commit 2de35d1

Browse files
committed
Added GitHub Actions CI.
1 parent 18b8f9a commit 2de35d1

File tree

3 files changed

+79
-0
lines changed

3 files changed

+79
-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: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
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+
# Output the hosts file.
31+
cat /etc/hosts
32+
- name: Script
33+
run: |
34+
set -x
35+
# Runs the script.
36+
sudo -E bash -e -o pipefail -- setup/start.sh
37+
# Verifies all the services are running by getting the HTTP headers.
38+
curl -sSIkL "https://$HOSTNAME/"
39+
curl -sSIkL "https://$HOSTNAME/admin"
40+
curl -sSIkL "https://$HOSTNAME/mail/"
41+
curl -sSIkL "https://$HOSTNAME/cloud/"
42+
# Runs the test suite. Uncomment these three lines once #777 is merged.
43+
# cd test
44+
# pip install -r requirements.txt
45+
# pytest
46+
47+
ShellCheck:
48+
name: ShellCheck
49+
50+
runs-on: ubuntu-latest
51+
steps:
52+
- uses: actions/checkout@v4
53+
- name: ShellCheck
54+
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
55+
# Remove this line once all errors are fixed.
56+
continue-on-error: true
57+
58+
Ruff:
59+
name: Ruff
60+
61+
runs-on: ubuntu-latest
62+
steps:
63+
- uses: actions/checkout@v4
64+
- name: Install dependencies
65+
run: |
66+
python3 -m pip install --upgrade pip
67+
python3 -m pip install ruff
68+
- name: Script
69+
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
70+
# Remove this line once all errors are fixed.
71+
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)