-
Notifications
You must be signed in to change notification settings - Fork 43
109 lines (85 loc) · 4.15 KB
/
ci-integration-tests.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
name: "CI - Integration Tests"
on:
schedule:
# at 9:45 UTC every day from Monday to Friday
- cron: "45 9 * * 1-5"
# allow running manually
workflow_dispatch:
jobs:
integration-tests:
timeout-minutes: 60
runs-on: ubuntu-latest
# do not run scheduled jobs in forks, in forks only allow manual run ("workflow_dispatch")
if: github.repository_owner == 'openSUSE' || github.event_name == 'workflow_dispatch'
steps:
# TODO: Reuse/share building the frontend and backend with the other steps
# TODO: Cache the Ruby gems and node packages
- name: Git Checkout
uses: actions/checkout@v3
with:
# fetch complete history with tags, agama.gemspec calls "git describe --tags"
# that would fail with just last commit checked out
fetch-depth: 0
fetch-tags: true
- name: Created shared YaST log directory
run: mkdir -p /tmp/log/YaST2
- name: Start container
run: podman run --privileged --detach --name agama --ipc=host -e CI -e GITHUB_ACTIONS -v /dev:/dev -v .:/checkout -v /tmp/log/YaST2:/var/log/YaST2 registry.opensuse.org/systemsmanagement/agama/staging/containers/opensuse/agama-testing:latest
- name: Environment
run: podman exec agama bash -c "env | sort"
- name: Build the frontend
run: podman exec agama bash -c "cd /checkout/web && npm install && make"
- name: Install the frontend
run: podman exec agama bash -c "ln -snfv /checkout/web/dist /usr/share/cockpit/agama"
# ./setup-services.sh will try setting up cockpit.socket
# which has a login page, so this local-session needs to be first
- name: Start Cockpit service
run: podman exec --detach agama /usr/libexec/cockpit-ws --local-session=/usr/bin/cockpit-bridge
- name: Remove Cockpit dependency
# Cockpit has been already started manually, starting it again as a unit dependency would fail
# remove the "Requires=cockpit.socket" line
run: podman exec agama bash -c "sed -i /Requires=cockpit.socket/d /checkout/service/share/agama.service"
- name: Setup service
run: podman exec agama bash -c "cd /checkout; ./setup-services.sh"
- name: Set a testing Agama configuration
# delete all products except TW to skip the product selection at the beginning
run: podman exec agama bash -c "ls /checkout/products.d/*.yaml | grep -v tumbleweed.yaml | xargs rm"
- name: Show NetworkManager log
run: podman exec agama journalctl -u NetworkManager
- name: Show the D-Bus services log
run: |
podman exec agama journalctl -u agama
podman exec agama systemctl status agama
- name: Inspect D-Bus services
run: podman exec agama busctl --address unix:path=/run/agama/bus
- name: Run the Agama smoke test
run: podman exec agama curl http://localhost:9090/cockpit/@localhost/agama/index.html
- name: Check Playwright version
run: podman exec agama playwright --version
- name: Run the Playwright tests
# user authentication is not required when cockpit runs a local session
# run the tests in the Chromium browser
run: podman exec agama bash -c "cd /checkout/playwright && SKIP_LOGIN=true playwright test --trace on --project chromium"
- name: Again show the D-Bus services log
# run even when any previous step fails
if: always()
run: podman exec agama journalctl
- name: Upload the test results
uses: actions/upload-artifact@v3
# run even when any previous step fails
if: always()
with:
name: test-results
retention-days: 30
path: |
playwright/test-results/**/*
/tmp/log/YaST2/y2log
- name: IRC notification
# see https://github.com/marketplace/actions/irc-message-action
uses: Gottox/irc-message-action@v2
# never run in forks or when triggered manually
if: failure() && github.repository_owner == 'openSUSE' && github.event_name != 'workflow_dispatch'
with:
channel: "#yast"
nickname: github-action
message: "Agama integration test failed: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"