Many Actions complain that an old Node20 code is used. Update the actions to use newer versions. https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/
125 lines
4.3 KiB
YAML
125 lines
4.3 KiB
YAML
name: "CI - Integration Tests"
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
on:
|
|
schedule:
|
|
# at 9:45 UTC every day from Monday to Friday
|
|
- cron: "45 9 * * Mon-Fri"
|
|
|
|
# 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.event.repository.fork) || 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@v6
|
|
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: Checkout integration tests
|
|
uses: actions/checkout@v6
|
|
with:
|
|
path: integration-tests
|
|
repository: ${{ github.repository_owner }}/integration-tests
|
|
fetch-depth: 1
|
|
|
|
- name: Build integration test
|
|
run: npm ci && ESLINT=0 npm run build
|
|
working-directory: ./integration-tests
|
|
|
|
- name: Created shared YaST log directory
|
|
run: mkdir -p /tmp/log/YaST2 /tmp/log/puppeteer
|
|
|
|
- name: Start container
|
|
# yaml syntax: > means fold newlines into a space, - means strip trailing newline
|
|
# see also https://yaml-multiline.info/
|
|
run: >-
|
|
podman run --privileged --detach --name agama --ipc=host -e CI -e GITHUB_ACTIONS
|
|
-v /dev:/dev -v .:/checkout -v /tmp/log/puppeteer:/var/log/puppeteer -v /tmp/log/YaST2:/var/log/YaST2
|
|
registry.opensuse.org/systemsmanagement/agama/devel/containers/opensuse/agama-testing:latest
|
|
|
|
- name: Environment
|
|
run: podman exec agama bash -c "env | sort"
|
|
|
|
- name: Packages
|
|
run: podman exec agama bash -c "rpm -qa | sort"
|
|
|
|
- name: Set the root password
|
|
# this allows to login into Agama
|
|
run: podman exec agama bash -c "echo linux | passwd --stdin"
|
|
|
|
- name: Build the frontend
|
|
run: podman exec agama bash -c "cd /checkout; ./setup-web.sh"
|
|
|
|
- name: Setup service
|
|
run: podman exec agama bash -c "cd /checkout; ./setup-services.sh"
|
|
|
|
- name: Wait for the server to start
|
|
# wait until the server is up and accepting the connections
|
|
run: podman exec agama bash -c 'for i in $(seq 30); do curl -s -o /dev/null http://localhost && exit 0; echo -n .; sleep 1; done'
|
|
|
|
- name: Show NetworkManager log
|
|
run: podman exec agama journalctl -u NetworkManager
|
|
|
|
- name: Show the D-Bus services log
|
|
run: |
|
|
podman exec agama systemctl status agama
|
|
podman exec agama journalctl -u agama
|
|
|
|
- name: Show the Web service log
|
|
run: podman exec agama journalctl -u agama-web-server
|
|
|
|
- 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
|
|
|
|
- name: Run the Service Integration Tests
|
|
run: podman exec agama bash -c "cd /checkout; (cd service; bundle exec rspec --pattern 'test/integration/**_itest.rb')"
|
|
|
|
- name: Run the Puppeteer tests
|
|
# run the test
|
|
run: podman exec agama bash -c "cd /var/log/puppeteer &&
|
|
node --enable-source-maps --test-reporter=spec /checkout/integration-tests/dist/test_root_password.js"
|
|
|
|
- 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@v6
|
|
# run even when any previous step fails
|
|
if: always()
|
|
with:
|
|
name: test-results
|
|
retention-days: 30
|
|
path: |
|
|
/tmp/log
|
|
|
|
- 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.event.repository.fork && github.event_name != 'workflow_dispatch'
|
|
with:
|
|
channel: "#yast"
|
|
nickname: agama-team-bot
|
|
sasl_password: ${{ secrets.AGAMA_TEAM_BOT_PASSWORD }}
|
|
message: "Agama integration test failed: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
|