Skip to content

Commit

Permalink
Merge branch 'master' into registration
Browse files Browse the repository at this point in the history
  • Loading branch information
joseivanlopez committed Nov 14, 2023
2 parents a6752fc + 5117d54 commit 03e29fa
Show file tree
Hide file tree
Showing 36 changed files with 1,897 additions and 469 deletions.
100 changes: 16 additions & 84 deletions .github/workflows/ci-integration-tests.yml
Original file line number Diff line number Diff line change
@@ -1,95 +1,18 @@
name: "CI - Integration Tests"

on:
push:
paths:
# NOTE: GitHub Actions do not allow using YAML references, the same path
# list is used below for the pull request event. Keep both lists in sync!!

# this file itself
- .github/workflows/ci-integration-tests.yml

# the web frontend
- web/**.json
- web/**.html
- web/**.scss
- web/**.jsx?
# ignore unit tests, we do not run them here
- "!web/**.test.jsx?"
- web/Makefile

# the service backend
- setup-service.sh
- service/lib/**.rb
- service/bin/agamactl
- service/Gemfile*
- service/*.gemspec
# D-Bus and systemd configs
- service/share/*.conf
- service/share/*.service
# Rust services
- rust/Cargo.lock
- rust/agama-dbus-server/**
- rust/agama-locale-data/**
- rust/agama-lib/**
# ignore the JSON profile and the examples
- "!rust/agama-lib/share/**"
- rust/share/*.service

# the playwright tests and configs
- playwright/**.ts
- playwright/config/agama.yaml

pull_request:
paths:
# NOTE: GitHub Actions do not allow using YAML references, the same path
# list is used above for the push event. Keep both lists in sync!!

# this file itself
- .github/workflows/ci-integration-tests.yml

# the web frontend
- web/**.json
- web/**.html
- web/**.scss
- web/**.jsx?
# ignore unit tests, we do not run them here
- "!web/**.test.jsx?"
- web/Makefile

# the service backend
- setup-service.sh
- service/lib/**.rb
- service/bin/agamactl
- service/Gemfile*
- service/*.gemspec
# D-Bus and systemd configs
- service/share/*.conf
- service/share/*.service
# Rust services
- rust/Cargo.lock
- rust/agama-dbus-server/**
- rust/agama-locale-data/**
- rust/agama-lib/**
# ignore the JSON profile and the examples
- "!rust/agama-lib/share/**"
- rust/share/*.service

# the playwright tests and configs
- playwright/**.ts
- playwright/config/agama.yaml
schedule:
# at 10:50 every day from Monday to Friday
- cron: "50 10 * * 1-5"

# allow running manually
workflow_dispatch:

jobs:
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
Expand Down Expand Up @@ -154,11 +77,20 @@ jobs:

- name: Upload the test results
uses: actions/upload-artifact@v3
# run even when the previous step fails
# 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
if: failure()
with:
channel: "#yast"
nickname: github-action
message: "Agama integration test failed: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
106 changes: 106 additions & 0 deletions .github/workflows/ci-rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: CI - Rust

on:
push:
paths:
# NOTE: GitHub Actions do not allow using YAML references, the same path
# list is used below for the pull request event. Keep both lists in sync!!

# this file as well
- .github/workflows/ci-rust.yml
# any change in the rust subfolder
- rust/**
# except Markdown documentation
- "!rust/**.md"
# except the packaging
- "!rust/package/**"
# except the DBus configuration
- "!rust/share/**"

pull_request:
paths:
# NOTE: GitHub Actions do not allow using YAML references, the same path
# list is used above for the push event. Keep both lists in sync!!

# this file as well
- .github/workflows/ci-rust.yml
# any change in the rust subfolder
- rust/**
# except Markdown documentation
- "!rust/**.md"
# except the packaging
- "!rust/package/**"
# except the DBus configuration
- "!rust/share/**"

# allow running manually
workflow_dispatch:

jobs:
rust_ci:
runs-on: ubuntu-latest
env:
COVERAGE: 1

defaults:
run:
working-directory: ./rust

strategy:
fail-fast: false
matrix:
distro: [ "tumbleweed" ]

container:
image: registry.opensuse.org/yast/head/containers_${{matrix.distro}}/yast-ruby
options: --security-opt seccomp=unconfined

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 Rust development files
run: zypper --non-interactive install rustup

- name: Install required packages
run: zypper --non-interactive install python-langtable-data openssl-3 libopenssl-3-devel jq

- name: Install Rust toolchains
run: rustup toolchain install stable

- name: Install cargo-binstall
uses: taiki-e/install-action@v2
with:
tool: cargo-binstall

- name: Install Tarpaulin (for code coverage)
run: cargo-binstall --no-confirm cargo-tarpaulin

- name: Run the tests
run: cargo tarpaulin --out xml

- name: Lint formatting
run: cargo fmt --all -- --check

# send the code coverage for the Rust part to the coveralls.io
- name: Coveralls GitHub Action
uses: coverallsapp/github-action@v2
with:
base-path: ./rust
format: cobertura
flag-name: rust
parallel: true

# close the code coverage and inherit the previous coverage for the Ruby and
# Web parts (it needs a separate step, the "carryforward" flag can be used
# only with the "parallel-finished: true" option)
- name: Coveralls Finished
uses: coverallsapp/github-action@v2
with:
parallel-finished: true
carryforward: "service,web"
93 changes: 93 additions & 0 deletions .github/workflows/ci-service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: CI - Service

on:
push:
paths:
# NOTE: GitHub Actions do not allow using YAML references, the same path
# list is used below for the pull request event. Keep both lists in sync!!

# this file as well
- .github/workflows/ci-service.yml
# any change in the service subfolder
- service/**
# except Markdown documentation
- "!service/**.md"
# except the packaging
- "!service/package/**"
# except the DBus configuration
- "!service/share/**"

pull_request:
paths:
# NOTE: GitHub Actions do not allow using YAML references, the same path
# list is used above for the push event. Keep both lists in sync!!

# this file as well
- .github/workflows/ci-service.yml
# any change in the service subfolder
- service/**
# except Markdown documentation
- "!service/**.md"
# except the packaging
- "!service/package/**"
# except the DBus configuration
- "!service/share/**"

# allow running manually
workflow_dispatch:

jobs:
ruby_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

- 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

# send the code coverage for the Ruby part to the coveralls.io
- name: Coveralls GitHub Action
uses: coverallsapp/github-action@v2
with:
base-path: ./service
flag-name: service
parallel: true

# close the code coverage and inherit the previous coverage for the Web and
# Rust parts (it needs a separate step, the "carryforward" flag can be used
# only with the "parallel-finished: true" option)
- name: Coveralls Finished
uses: coverallsapp/github-action@v2
with:
parallel-finished: true
carryforward: "rust,web"
Loading

0 comments on commit 03e29fa

Please sign in to comment.