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

Make GitHub Actions smoke-test Caddyfile.generate #3

Merged
merged 2 commits into from
Apr 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 2
updates:

- package-ecosystem: "github-actions"
commit-message:
include: "scope"
prefix: "Actions"
directory: "/"
labels:
- "enhancement"
schedule:
interval: "weekly"
32 changes: 32 additions & 0 deletions .github/workflows/expected-output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
--- /tmp/tmpcdry5mph 2024-04-21 19:36:45.813805199 +0200
+++ Caddyfile 2024-04-21 19:36:45.813805199 +0200
@@ -0,0 +1,27 @@
+# NOTE: This file has been generated, do not edit
+(common) {
+ encode zstd gzip
+ log {
+ output stdout
+ }
+}
+
+example.org {
+ import common
+ reverse_proxy example-org:80
+}
+
+example.net {
+ import common
+ redir https://example.org{uri}
+}
+
+www.example.net {
+ import common
+ redir https://example.org{uri}
+}
+
+www.example.org {
+ import common
+ redir https://example.org{uri}
+}

changed=yes comment='Caddyfile changed'
36 changes: 36 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Copyright (c) 2024 Sebastian Pipping <[email protected]>
# Licensed under GNU Affero GPL v3 or later

name: Run smoke test

# Drop permissions to minimum for security
permissions:
contents: read

on:
pull_request:
push:
schedule:
- cron: '0 16 * * 5' # Every Friday 4pm
workflow_dispatch:

jobs:
smoke_test:
name: Run the test suite
strategy:
matrix:
python-version: [3.8, 3.12] # no particular need for in-between versions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: ${{ matrix.python-version }}
- name: Run smoke test
run: |
set -x
python3 --version
./Caddyfile.generate --config sites.cfg.EXAMPLE --saltstack > actual-output.txt
diff -u0 \
<(tail -n +3 .github/workflows/expected-output.txt) \
<(tail -n +3 actual-output.txt)