-
-
Notifications
You must be signed in to change notification settings - Fork 106
111 lines (109 loc) · 3.51 KB
/
container-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: Docker container test
on:
workflow_call:
inputs:
variant:
required: true
type: string
test:
required: true
type: string
weblate_sha:
required: false
type: string
weblate_date:
required: false
type: string
port:
required: false
type: number
protocol:
required: false
type: string
jobs:
container-test:
runs-on: ubuntu-24.04
name: Test container ${{ inputs.test }}, ${{ inputs.variant }}
env:
MATRIX_ARCHITECTURE: linux/amd64
COMPOSE_PROJECT_NAME: wl
PYTHONUNBUFFERED: 1
TEST_CONTAINER: weblate/weblate:test
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Expose GitHub Runtime
uses: crazy-max/ghaction-github-runtime@v3
- name: Set up Docker Buildx
uses: docker/[email protected]
with:
# renovate: datasource=github-releases depName=docker/buildx
version: v0.20.1
- name: Adjust bleeding edge image
if: inputs.variant == 'bleeding'
run: .github/bin/bleeding ${{inputs.weblate_sha}} ${{inputs.weblate_date}}
- name: Build the Docker image
run: .github/bin/docker-build load
- name: List Docker images
run: docker image ls --all
- name: Test content
run: ./docker-compose/test-content
- name: Generate configuration
working-directory: docker-compose
run: ./test-generate ${{ inputs.port || 8080 }} ${{ inputs.protocol || 'http' }} ${{ inputs.test }}
- name: Generate SSL certificate
if: inputs.protocol == 'https'
working-directory: docker-compose
run: |
docker compose up --no-start
VOLUMEPATH=$(docker volume inspect -f '{{.Mountpoint}}' wl_weblate-data)
sudo mkdir -p $VOLUMEPATH/ssl
sudo openssl req -x509 -nodes -days 365 -subj "/CN=localhost" -newkey rsa:2048 -keyout $VOLUMEPATH/ssl/privkey.pem -out $VOLUMEPATH/ssl/fullchain.pem
sudo chown -R 1000:1000 $VOLUMEPATH/ssl
- name: Startup container
working-directory: docker-compose
run: ./test-boot
- name: List Python packages
working-directory: docker-compose
run: ./test-pip
- name: Inspect container
working-directory: docker-compose
run: ./test-inspect
- name: Check service is running
working-directory: docker-compose
run: ./test-online
- name: Check service health status
working-directory: docker-compose
run: ./test-health
- name: Run Django Checks
working-directory: docker-compose
run: ./test-checks
- name: Verify supervisor
working-directory: docker-compose
run: ./test-supervisor
- name: Test admin creation
working-directory: docker-compose
run: ./test-admin
- name: Verify SAML certificate
working-directory: docker-compose
run: ./test-saml ${{ inputs.test }}
- name: Test commands
working-directory: docker-compose
run: ./test-commands
- name: Display logs
if: always()
working-directory: docker-compose
run: ./test-logs
- name: Stop Weblate service
working-directory: docker-compose
run: docker compose stop weblate
- name: Start Weblate service
working-directory: docker-compose
run: docker compose start weblate
- name: Check service is running
working-directory: docker-compose
run: ./test-online
- name: Shutdown service
working-directory: docker-compose
run: ./test-stop