Merge pull request #588 from openSUSE/fix-css-filters #5680
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: [push, pull_request] | |
jobs: | |
frontend_build: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./web | |
strategy: | |
matrix: | |
node-version: ["18.x"] | |
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'npm' | |
cache-dependency-path: 'web/package-lock.json' | |
- name: Install dependencies | |
run: npm install | |
- name: Build the application | |
run: make | |
- name: Run check spell | |
run: npm run cspell | |
- name: Check types | |
run: npm run check-types | |
- name: Run ESLint | |
run: npm run eslint | |
- name: Run Stylelint | |
run: npm run stylelint | |
- name: Run the tests and generate coverage report | |
run: npm test -- --coverage | |
- name: Coveralls GitHub Action | |
uses: coverallsapp/github-action@v1 | |
with: | |
base-path: ./web | |
path-to-lcov: ./web/coverage/lcov.info | |
flag-name: frontend | |
parallel: true | |
backend_tests: | |
runs-on: ubuntu-latest | |
env: | |
COVERAGE: 1 | |
defaults: | |
run: | |
working-directory: ./service | |
strategy: | |
fail-fast: false | |
matrix: | |
distro: [ "tumbleweed" ] | |
container: | |
image: registry.opensuse.org/yast/head/containers_${{matrix.distro}}/yast-ruby | |
steps: | |
- name: Git Checkout | |
uses: actions/checkout@v3 | |
- name: Configure and refresh repositories | |
# disable unused repositories to have faster refresh | |
run: zypper modifyrepo -d repo-non-oss repo-openh264 repo-update && ( zypper ref || zypper ref || zypper ref ) | |
- name: Install Ruby development files | |
run: zypper --non-interactive install gcc gcc-c++ make openssl-devel ruby-devel npm augeas-devel | |
- name: Install required packages | |
run: zypper --non-interactive install yast2-iscsi-client | |
- name: Install RubyGems dependencies | |
run: bundle config set --local with 'development' && bundle install | |
- name: Run the tests and generate coverage report | |
run: bundle exec rspec | |
- name: Coveralls GitHub Action | |
uses: coverallsapp/github-action@v1 | |
with: | |
base-path: ./service | |
path-to-lcov: ./service/coverage/lcov.info | |
flag-name: backend | |
parallel: true | |
backend_linter: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./service | |
strategy: | |
fail-fast: false | |
matrix: | |
distro: [ "leap_latest" ] | |
container: | |
image: registry.opensuse.org/yast/head/containers_${{matrix.distro}}/yast-ruby | |
steps: | |
- name: Git Checkout | |
uses: actions/checkout@v3 | |
- name: Rubocop | |
run: /usr/bin/rubocop.*-1.24.1 | |
backend_doc: | |
runs-on: ubuntu-latest | |
env: | |
COVERAGE: 1 | |
defaults: | |
run: | |
working-directory: ./service | |
strategy: | |
fail-fast: false | |
matrix: | |
distro: [ "tumbleweed" ] | |
container: | |
image: registry.opensuse.org/yast/head/containers_${{matrix.distro}}/yast-ruby | |
steps: | |
- name: Git Checkout | |
uses: actions/checkout@v3 | |
- name: Configure and refresh repositories | |
# disable unused repositories to have faster refresh | |
run: zypper modifyrepo -d repo-non-oss repo-openh264 repo-update && ( zypper ref || zypper ref || zypper ref ) | |
- name: Install Ruby development files | |
run: zypper --non-interactive install gcc gcc-c++ make openssl-devel ruby-devel npm augeas-devel | |
- name: Install RubyGems dependencies | |
run: bundle config set --local with 'development' && bundle install | |
- name: Generate doc | |
run: bundle exec yardoc --fail-on-warning | |
integration-tests: | |
timeout-minutes: 60 | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
# TW is needed because of the Cockpit packages | |
distro: [ "tumbleweed" ] | |
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 | |
- 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/yast/head/containers/containers_tumbleweed/opensuse/agama-testing:latest | |
- name: Environment | |
run: podman exec agama bash -c "env | sort" | |
- name: Install Ruby gems | |
run: podman exec agama bash -c "cd /checkout/service && bundle config set --local path 'vendor/bundle' && bundle install" | |
- name: Install the Agama D-Bus configuration | |
run: podman exec agama bash -c "cp /checkout/service/share/dbus.conf /usr/share/dbus-1/system.d/org.opensuse.Agama.conf" | |
- name: Set a testing Agama configuration | |
# copy a simplified ALP config file, it skips the product selection at the beginning | |
run: podman exec agama bash -c "cp /checkout/playwright/config/agama.yaml /checkout/service/etc/agama.yaml" | |
- name: Start NetworkManager | |
# We need to run it manually as systemd dbus activation looks like failing | |
run: podman exec agama /usr/sbin/NetworkManager | |
- name: Reload the D-Bus service | |
run: podman exec agama systemctl reload dbus | |
- name: Start the Agama D-Bus services | |
# TODO: here is a potential race condition, but as building the frontend | |
# takes quite long time it should never happen™ | |
run: podman exec agama bash -c "cd /checkout/service && (bundle exec bin/agamactl > service.log 2>&1 &)" | |
- name: Build the frontend | |
run: podman exec agama bash -c "cd /checkout/web && npm install && make" | |
- name: Show the D-Bus services log | |
run: podman exec agama cat /checkout/service/service.log | |
- name: Check DBus socket | |
run: podman exec agama ls -l /var/run/dbus/system_bus_socket | |
- name: Show journal | |
run: podman exec agama journalctl -b || echo "journal failed with $?" | |
- name: Install the frontend | |
run: podman exec agama bash -c "ln -snfv /checkout/web/dist /usr/share/cockpit/agama" | |
- name: Start Cockpit service | |
run: podman exec --detach agama /usr/libexec/cockpit-ws --local-session=/usr/bin/cockpit-bridge | |
- 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: Upload the test results | |
uses: actions/upload-artifact@v3 | |
# run even when the previous step fails | |
if: always() | |
with: | |
name: test-results | |
retention-days: 30 | |
path: | | |
playwright/test-results/**/* | |
/tmp/log/YaST2/y2log | |
cli_build: | |
runs-on: ubuntu-latest | |
env: | |
CARGO_TERM_COLOR: always | |
defaults: | |
run: | |
working-directory: ./rust | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build | |
run: cargo build --verbose | |
- name: Run tests | |
run: cargo test --verbose | |
finish: | |
runs-on: ubuntu-latest | |
needs: [frontend_build, backend_tests] | |
steps: | |
- name: Coveralls Finished | |
uses: coverallsapp/github-action@v1 | |
with: | |
parallel-finished: true |