diff --git a/.github/workflows/ci-doc-check.yml b/.github/workflows/ci-doc-check.yml deleted file mode 100644 index 9531228a1e..0000000000 --- a/.github/workflows/ci-doc-check.yml +++ /dev/null @@ -1,77 +0,0 @@ -name: "CI - Documentation Check" - -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-doc-check.yml - # all Ruby files - - service/Gemfile* - - service/*.gemspec - - service/**.rb - # the D-Bus introspection files - - doc/dbus/**.xml - - 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-doc-check.yml - # all Ruby files - - service/Gemfile* - - service/*.gemspec - - service/**.rb - # the D-Bus introspection files - - doc/dbus/**.xml - -jobs: - doc_check: - runs-on: ubuntu-latest - - container: - image: registry.opensuse.org/opensuse/tumbleweed:latest - - steps: - - - name: Git Checkout - uses: actions/checkout@v3 - - - name: Fix the file owner - # fix the file owner - run: chown -R -c 0 . - - - 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 and XML tooling - run: zypper --non-interactive install --no-recommends - gcc gcc-c++ make libopenssl-devel ruby-devel augeas-devel diff - libxslt-devel libxml2-devel xmlstarlet - - - name: Cache RubyGems - uses: actions/cache@v3 - with: - key: "Gemfile-${{ hashFiles('service/Gemfile.lock') }}" - path: service/vendor/bundle - - - name: Install RubyGems - env: - NOKOGIRI_USE_SYSTEM_LIBRARIES: 1 - run: | - bundle config set --local path 'vendor/bundle' - bundle install - working-directory: ./service - - - name: Generate doc - run: bundle exec yardoc --fail-on-warning - working-directory: ./service - - - name: Check that introspected API and its docs have not diverged - run: make check - working-directory: ./doc diff --git a/.github/workflows/ci-integration-tests.yml b/.github/workflows/ci-integration-tests.yml deleted file mode 100644 index 7f7fdf87cb..0000000000 --- a/.github/workflows/ci-integration-tests.yml +++ /dev/null @@ -1,164 +0,0 @@ -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 - -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 - # 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/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-service.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: Setup service - run: podman exec agama bash -c "cd /checkout; ./setup-service.sh" - - - 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: Show NetworkManager log - run: podman exec agama journalctl -u NetworkManager - - - name: Show the D-Bus services log - run: podman exec agama bash -c "journalctl | grep agama" - - - name: Check D-Bus socket - run: podman exec agama ls -l /var/run/dbus/system_bus_socket - - - 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: podman exec agama bash -c "journalctl | grep agama" - - - name: Show the complete journal - # maybe not necessary if the above filtered journalctl calls are enough - run: podman exec agama journalctl -b || echo "journal failed with $?" - - - 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 diff --git a/.github/workflows/ci-rubocop.yml b/.github/workflows/ci-rubocop.yml deleted file mode 100644 index 067ee6b367..0000000000 --- a/.github/workflows/ci-rubocop.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: "CI - Rubocop" - -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-rubocop.yml - # Rubocop configuration - - service/.rubocop.yml - # all Ruby files - - service/Gemfile - - service/bin/** - - service/**.rb - - 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-rubocop.yml - # Rubocop configuration - - service/.rubocop.yml - # all Ruby files - - service/Gemfile - - service/bin/** - - service/**.rb - -jobs: - rubocop: - 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 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index d941c5d41d..0000000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,169 +0,0 @@ -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@v2 - with: - base-path: ./web - flag-name: frontend - parallel: true - - 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 || 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@v2 - with: - base-path: ./service - flag-name: backend - parallel: true - - 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 - - - name: Coveralls GitHub Action - uses: coverallsapp/github-action@v2 - with: - base-path: ./rust - format: cobertura - flag-name: rust-backend - parallel: true - - finish: - runs-on: ubuntu-latest - - needs: [frontend_build, ruby_tests, rust_ci] - - steps: - - - name: Coveralls Finished - uses: coverallsapp/github-action@v1 - with: - parallel-finished: true diff --git a/.github/workflows/configure_osc.sh b/.github/workflows/configure_osc.sh deleted file mode 100755 index 193164b463..0000000000 --- a/.github/workflows/configure_osc.sh +++ /dev/null @@ -1,15 +0,0 @@ -#! /bin/bash - -# This helper script creates the "osc" configuration file with OBS credentials - -CONFIG_FILE="$HOME/.config/osc/oscrc" - -# do not overwrite the existing config accidentally -if [ -e "$CONFIG_FILE" ]; then - echo "ERROR: $CONFIG_FILE already exists" - exit 1 -fi - -TEMPLATE=$(dirname "${BASH_SOURCE[0]}")/oscrc.template -mkdir -p $(dirname "$CONFIG_FILE") -sed -e "s/@OBS_USER@/$OBS_USER/g" -e "s/@OBS_PASSWORD@/$OBS_PASSWORD/g" "$TEMPLATE" > "$CONFIG_FILE" diff --git a/.github/workflows/github-pages.yml b/.github/workflows/github-pages.yml deleted file mode 100644 index 9d3c6505b0..0000000000 --- a/.github/workflows/github-pages.yml +++ /dev/null @@ -1,68 +0,0 @@ -# Simple workflow for deploying static content to GitHub Pages -name: GitHub Pages - -on: - # Runs on pushes targeting the default branch - push: - branches: - - master - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages -permissions: - contents: read - pages: write - id-token: write - -# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. -# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. -concurrency: - group: "pages" - cancel-in-progress: false - -jobs: - # Single deploy job since we're just deploying - pages_deploy: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Install DocBook tooling - run: | - sudo apt-get update - sudo apt-get --assume-yes --no-install-recommends install xmlto docbook-xsl xmlstarlet - - - name: Build HTML via DocBook - run: make -C doc - - - name: Install Node.js - uses: actions/setup-node@v3 - with: - node-version: '18.x' - cache: 'npm' - cache-dependency-path: 'web/package-lock.json' - - - name: Install NPM packages - run: cd web && npm ci - - - name: Build the JSDoc documentation - run: cd web && npm run jsdoc && mv jsdoc.out ../doc/dist/jsdoc - - - name: Setup Pages - uses: actions/configure-pages@v3 - - - name: Upload artifact - uses: actions/upload-pages-artifact@v1 - with: - # upload the built docs - path: 'doc/dist' - - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v2 diff --git a/.github/workflows/migrate-wicked-ci.yml b/.github/workflows/migrate-wicked-ci.yml new file mode 100644 index 0000000000..e0fdfca314 --- /dev/null +++ b/.github/workflows/migrate-wicked-ci.yml @@ -0,0 +1,27 @@ +name: "migrate-wicked CI" + +on: [push, pull_request] + +env: + CARGO_TERM_COLOR: always + +jobs: + rust_ci: + runs-on: ubuntu-latest + + defaults: + run: + working-directory: ./rust/agama-migrate-wicked + + strategy: + fail-fast: false + + steps: + - name: Git Checkout + uses: actions/checkout@v3 + - name: Build + run: cargo build --verbose + - name: Run tests + run: cargo test --verbose + - name: Run lint tests + run: cargo fmt --all -- --check diff --git a/.github/workflows/migrate-wicked-integration-tests.yml b/.github/workflows/migrate-wicked-integration-tests.yml new file mode 100644 index 0000000000..97cd4671a4 --- /dev/null +++ b/.github/workflows/migrate-wicked-integration-tests.yml @@ -0,0 +1,23 @@ +name: "migrate-wicked CI - Integration Tests" + +on: [push, pull_request] + +env: + CARGO_TERM_COLOR: always + +jobs: + integration-tests: + runs-on: ubuntu-latest + + strategy: + fail-fast: false + + steps: + - name: Git Checkout + uses: actions/checkout@v3 + - name: Start container + run: podman run --privileged --detach --name migrate-wicked --ipc=host -e CARGO_TERM_COLOR=always -v /dev:/dev -v .:/checkout registry.opensuse.org/home/jcronenberg/github-ci/containers/opensuse/migrate-wicked-testing:latest + - name: Build migrate-wicked + run: podman exec migrate-wicked bash -c "cd /checkout/rust/agama-migrate-wicked/ && cargo build" + - name: Run migration integration tests + run: podman exec migrate-wicked bash -c "cd /checkout/rust/agama-migrate-wicked/tests/ && ./test.sh" diff --git a/.github/workflows/obs-release.yml b/.github/workflows/obs-release.yml deleted file mode 100644 index c31034c5fd..0000000000 --- a/.github/workflows/obs-release.yml +++ /dev/null @@ -1,39 +0,0 @@ -# Publish a new version -# - Submit the packages to systemsmanagement:Agama:Devel -# - Send submit requests - -name: Release - -on: - # runs when creating a release tag - push: - tags: - - v[0-9]* - -jobs: - # Note: cockpit-agama-playwright is currently not submitted - - update_rust: - uses: ./.github/workflows/obs-staging-shared.yml - # pass all secrets - secrets: inherit - with: - install_packages: obs-service-cargo_audit obs-service-cargo_vendor - project_name: systemsmanagement:Agama:Devel - package_name: agama-cli - - update_web: - uses: ./.github/workflows/obs-staging-shared.yml - # pass all secrets - secrets: inherit - with: - install_packages: obs-service-node_modules - project_name: systemsmanagement:Agama:Devel - package_name: cockpit-agama - - update_service: - uses: ./.github/workflows/obs-service-shared.yml - # pass all secrets - secrets: inherit - with: - project_name: systemsmanagement:Agama:Devel diff --git a/.github/workflows/obs-service-shared.yml b/.github/workflows/obs-service-shared.yml deleted file mode 100644 index 62a035e0a8..0000000000 --- a/.github/workflows/obs-service-shared.yml +++ /dev/null @@ -1,80 +0,0 @@ -# this is a shared workflow, not called as a top level workflow - -name: Update OBS Service Package - -on: - workflow_call: - secrets: - OBS_USER: - required: true - OBS_PASSWORD: - required: true - - inputs: - project_name: - description: OBS project name - required: true - type: string - -jobs: - update_service: - # do not run in forks - if: github.repository == 'openSUSE/agama' - - runs-on: ubuntu-latest - - container: - image: registry.opensuse.org/opensuse/tumbleweed:latest - - steps: - - name: Configure and refresh repositories - # disable unused repositories to have a faster refresh - run: zypper modifyrepo -d repo-non-oss repo-openh264 repo-update && zypper ref - - - name: Install tools - run: zypper --non-interactive install --no-recommends - git - obs-service-format_spec_file - osc - ruby - 'rubygem(gem2rpm)' - 'rubygem(yast-rake)' - - - name: Git Checkout (full history) - if: ${{ github.ref_type != 'tag' }} - uses: actions/checkout@v3 - with: - # fetch all history, we need to find the latest tag and offset for the version number - fetch-depth: 0 - - - name: Git Checkout (release tag only) - if: ${{ github.ref_type == 'tag' }} - uses: actions/checkout@v3 - - - name: Fix file owner - # workaround for a strict git check - run: chown -R -c 0 . - - - name: Configure osc - run: .github/workflows/configure_osc.sh - env: - OBS_USER: ${{ secrets.OBS_USER }} - OBS_PASSWORD: ${{ secrets.OBS_PASSWORD }} - - - name: Commit the rubygem-agama package to ${{ inputs.project_name }} - run: rake osc:commit - working-directory: ./service - env: - # do not build the package with "osc", it takes long time - # and does not provide much value - SKIP_OSC_BUILD: 1 - OBS_PROJECT: ${{ inputs.project_name }} - - - name: Submit the rubygem-agama package - # only when a tag has been pushed - if: ${{ github.ref_type == 'tag' }} - # the package has been comitted in the previous step, just submit it - run: rake osc:sr:force - working-directory: ./service - env: - OBS_PROJECT: ${{ inputs.project_name }} diff --git a/.github/workflows/obs-staging-playwright.yml b/.github/workflows/obs-staging-playwright.yml deleted file mode 100644 index 3c9d58bc87..0000000000 --- a/.github/workflows/obs-staging-playwright.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Submit cockpit-agama-playwright - -on: - # runs on pushes targeting the default branch - push: - branches: - - master - paths: - # run only when a Playwright source is changed - - playwright/** - -jobs: - update_staging: - uses: ./.github/workflows/obs-staging-shared.yml - # pass all secrets - secrets: inherit - with: - project_name: systemsmanagement:Agama:Staging - package_name: cockpit-agama-playwright diff --git a/.github/workflows/obs-staging-rust.yml b/.github/workflows/obs-staging-rust.yml deleted file mode 100644 index b83f6759f7..0000000000 --- a/.github/workflows/obs-staging-rust.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Submit agama-cli - -on: - # runs on pushes targeting the default branch - push: - branches: - - master - paths: - # run only when a Rust source is changed - - rust/** - -jobs: - update_staging: - uses: ./.github/workflows/obs-staging-shared.yml - # pass all secrets - secrets: inherit - with: - install_packages: obs-service-cargo_audit obs-service-cargo_vendor - project_name: systemsmanagement:Agama:Staging - package_name: agama-cli diff --git a/.github/workflows/obs-staging-service.yml b/.github/workflows/obs-staging-service.yml deleted file mode 100644 index 5d3cb47bf5..0000000000 --- a/.github/workflows/obs-staging-service.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Submit rubygem-agama - -on: - # runs on pushes targeting the default branch - push: - branches: - - master - paths: - # run only when a service source is changed - - service/** - - Rakefile - -jobs: - update_service: - uses: ./.github/workflows/obs-service-shared.yml - # pass all secrets - secrets: inherit - with: - project_name: systemsmanagement:Agama:Staging diff --git a/.github/workflows/obs-staging-shared.yml b/.github/workflows/obs-staging-shared.yml deleted file mode 100644 index 55eae4315e..0000000000 --- a/.github/workflows/obs-staging-shared.yml +++ /dev/null @@ -1,90 +0,0 @@ -# this is a shared workflow, not called as a top level workflow - -name: Update OBS Packages - -on: - workflow_call: - secrets: - OBS_USER: - required: true - OBS_PASSWORD: - required: true - - inputs: - install_packages: - description: Additional packages to install - required: false - type: string - - package_name: - description: OBS package name - required: true - type: string - - project_name: - description: OBS project name - required: true - type: string - -jobs: - update_staging_package: - # do not run in forks - if: github.repository == 'openSUSE/agama' - - runs-on: ubuntu-latest - - container: - image: registry.opensuse.org/opensuse/tumbleweed:latest - - steps: - - name: Git Checkout - uses: actions/checkout@v3 - - - name: Configure and refresh repositories - # disable unused repositories to have a faster refresh - run: zypper modifyrepo -d repo-non-oss repo-openh264 repo-update && zypper ref - - - name: Install tools - run: zypper --non-interactive install --no-recommends - cpio - obs-service-download_files - obs-service-format_spec_file - obs-service-obs_scm - osc - ${{ inputs.install_packages }} - - - name: Configure osc - run: .github/workflows/configure_osc.sh - env: - OBS_USER: ${{ secrets.OBS_USER }} - OBS_PASSWORD: ${{ secrets.OBS_PASSWORD }} - - - name: Checkout ${{ inputs.package_name }} - run: osc co ${{ inputs.project_name }} ${{ inputs.package_name }} - - - name: Update service revision - # only when a tag has been pushed - if: ${{ github.ref_type == 'tag' }} - run: |- - echo "Updating revision to ${{ github.ref_name }}" - sed -i -e 's#.*#${{ github.ref_name }}#' _service - working-directory: ./${{ inputs.project_name }}/${{ inputs.package_name }} - - - name: Run services - run: osc service manualrun - working-directory: ./${{ inputs.project_name }}/${{ inputs.package_name }} - - - name: Check status - run: osc diff && osc status - working-directory: ./${{ inputs.project_name }}/${{ inputs.package_name }} - - - name: Commit ${{ inputs.package_name }} - run: |- - osc commit -m "Updated to $(sed -e '/^version:/!d' -e 's/version: *\(.*\)/\1/' agama.obsinfo) ($(sed -e '/^commit:/!d' -e 's/commit: *\(.*\)/\1/' agama.obsinfo))" - working-directory: ./${{ inputs.project_name }}/${{ inputs.package_name }} - - - name: Submit the package - # only when a tag has been pushed - if: ${{ github.ref_type == 'tag' }} - run: osc sr --yes -m "Releasing version ${{ github.ref_name }}" - working-directory: ./${{ inputs.project_name }}/${{ inputs.package_name }} diff --git a/.github/workflows/obs-staging-web.yml b/.github/workflows/obs-staging-web.yml deleted file mode 100644 index fa2a9731f8..0000000000 --- a/.github/workflows/obs-staging-web.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Submit cockpit-agama - -on: - # runs on pushes targeting the default branch - push: - branches: - - master - paths: - # run only when a web frontend source is changed - - web/** - -jobs: - update_staging: - uses: ./.github/workflows/obs-staging-shared.yml - # pass all secrets - secrets: inherit - with: - install_packages: obs-service-node_modules - project_name: systemsmanagement:Agama:Staging - package_name: cockpit-agama diff --git a/.github/workflows/oscrc.template b/.github/workflows/oscrc.template deleted file mode 100644 index e6133a0677..0000000000 --- a/.github/workflows/oscrc.template +++ /dev/null @@ -1,7 +0,0 @@ -[general] -apiurl = https://api.opensuse.org - -[https://api.opensuse.org] -user=@OBS_USER@ -pass=@OBS_PASSWORD@ -credentials_mgr_class=osc.credentials.PlaintextConfigFileCredentialsManager diff --git a/.github/workflows/weblate-merge-po.yml b/.github/workflows/weblate-merge-po.yml deleted file mode 100644 index 244e9b2aa9..0000000000 --- a/.github/workflows/weblate-merge-po.yml +++ /dev/null @@ -1,110 +0,0 @@ -name: Weblate Merge PO - -on: - schedule: - # run every Monday at 2:42AM UTC - - cron: "42 2 * * 0" - - # allow running manually - workflow_dispatch: - -jobs: - merge-po: - # allow pushing and creating pull requests - permissions: - contents: write - pull-requests: write - - # do not run in forks - if: github.repository == 'openSUSE/agama' - - runs-on: ubuntu-latest - - container: - image: registry.opensuse.org/opensuse/tumbleweed:latest - - steps: - - name: Configure and refresh repositories - run: | - # install the GitHub command line tool "gh" - zypper addrepo https://cli.github.com/packages/rpm/gh-cli.repo - # disable unused repositories to have a faster refresh - zypper modifyrepo -d repo-non-oss repo-openh264 repo-update && \ - zypper --non-interactive --gpg-auto-import-keys ref - - - name: Install tools - run: zypper --non-interactive install --no-recommends gh git gettext-tools - - - name: Configure Git - run: | - git config --global user.name "YaST Bot" - git config --global user.email "yast-devel@opensuse.org" - - - name: Checkout sources - uses: actions/checkout@v3 - with: - path: agama - - - name: Checkout Agama-weblate sources - uses: actions/checkout@v3 - with: - path: agama-weblate - repository: openSUSE/agama-weblate - - - name: Update PO files - working-directory: ./agama - run: | - mkdir -p web/po - # delete the current translations - find web/po -name '*.po' -exec git rm '{}' ';' - - # copy the new ones - mkdir -p web/po - cp -a ../agama-weblate/web/*.po web/po - git add web/po/*.po - - - name: Validate the PO files - working-directory: ./agama - run: ls web/po/*.po | xargs -n1 msgfmt --check-format -o /dev/null - - # any changes besides the timestamps in the PO files? - - name: Check changes - id: check_changes - working-directory: ./agama - run: | - git diff --staged --ignore-matching-lines="POT-Creation-Date:" \ - --ignore-matching-lines="PO-Revision-Date:" web/po > po.diff - - if [ -s po.diff ]; then - echo "PO files updated" - # this is an Output Parameter - # https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-output-parameter - echo "po_updated=true" >> $GITHUB_OUTPUT - else - echo "PO files unchanged" - echo "po_updated=false" >> $GITHUB_OUTPUT - fi - - rm po.diff - - - name: Push updated PO files - # run only when a PO file has been updated - if: steps.check_changes.outputs.po_updated == 'true' - working-directory: ./agama - run: | - # use a unique branch to avoid possible conflicts with already existing branches - git checkout -b "po_merge_${GITHUB_RUN_ID}" - git commit -a -m "Update PO files"$'\n\n'"Agama-weblate commit: `git -C ../agama-weblate rev-parse HEAD`" - git push origin "po_merge_${GITHUB_RUN_ID}" - - - name: Create pull request - # run only when a PO file has been updated - if: steps.check_changes.outputs.po_updated == 'true' - working-directory: ./agama - run: | - gh pr create -B master -H "po_merge_${GITHUB_RUN_ID}" \ - --label translations --label bot \ - --title "Update PO files" \ - --body "Updating the translation files from the agama-weblate repository" - env: - GH_TOKEN: ${{ github.token }} diff --git a/.github/workflows/weblate-update-pot.yml b/.github/workflows/weblate-update-pot.yml deleted file mode 100644 index a833ce1284..0000000000 --- a/.github/workflows/weblate-update-pot.yml +++ /dev/null @@ -1,81 +0,0 @@ -name: Weblate Update POT - -on: - schedule: - # run every working day (Monday-Friday) at 1:42AM UTC - - cron: "42 1 * * 0-4" - - # allow running manually - workflow_dispatch: - -jobs: - update-pot: - # do not run in forks - if: github.repository == 'openSUSE/agama' - - runs-on: ubuntu-latest - - container: - image: registry.opensuse.org/opensuse/tumbleweed:latest - - steps: - - name: Configure and refresh repositories - # disable unused repositories to have a faster refresh - run: zypper modifyrepo -d repo-non-oss repo-openh264 repo-update && zypper ref - - - name: Install tools - run: zypper --non-interactive install --no-recommends diffutils git gettext-tools - - - name: Checkout Agama sources - uses: actions/checkout@v3 - with: - path: agama - - - name: Generate POT file - run: | - cd agama/web - ./build_pot - msgfmt --statistics agama.pot - - - name: Validate the generated POT file - run: msgfmt --check-format agama/web/agama.pot - - - name: Checkout Weblate sources - uses: actions/checkout@v3 - with: - path: agama-weblate - repository: openSUSE/agama-weblate - token: ${{ secrets.GH_TOKEN }} - - - name: Configure Git - run: | - git config --global user.name "YaST Bot" - git config --global user.email "yast-devel@opensuse.org" - - - name: Update POT file - run: | - mkdir -p agama-weblate/web - cp agama/web/agama.pot agama-weblate/web/agama.pot - - # any change besides the timestamp in the POT file? - - name: Check changes - id: check_changes - run: | - git -C agama-weblate diff --ignore-matching-lines="POT-Creation-Date:" web/agama.pot > pot.diff - - if [ -s pot.diff ]; then - echo "POT file updated" - echo "pot_updated=true" >> $GITHUB_OUTPUT - else - echo "POT file unchanged" - echo "pot_updated=false" >> $GITHUB_OUTPUT - fi - - - name: Push updated POT file - # run only when the POT file has been updated - if: steps.check_changes.outputs.pot_updated == 'true' - run: | - cd agama-weblate - git add web/agama.pot - git commit -m "Update POT file"$'\n\n'"Agama commit: $GITHUB_SHA" - git push