1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-22 18:50:08 +03:00

M #-: enable GitHub Actions smoke tests

Same principles that with Travis tests. This commit enables:

 - Configuration protection on branch
 - Rubocop

(cherry picked from commit 975cc258479f4fa8bffa07672a6dbc1e951e2d4f)
This commit is contained in:
Tino Vazquez 2021-06-30 18:09:23 +02:00
parent 03244dd3bc
commit 7966e1ce17
No known key found for this signature in database
GPG Key ID: 14201E424D02047E
9 changed files with 45 additions and 4 deletions

36
.github/workflows/smoke_tests.yml vendored Normal file
View File

@ -0,0 +1,36 @@
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
pull_request:
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
- name: Install rubocop
run: gem install rubocop
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
# Runs a single command using the runners shell
- name: Run Smoke Tests
run: $GITHUB_WORKSPACE/share/smoke_tests/smoke_tests.sh

View File

@ -1,8 +1,8 @@
## Travis smoke tests
## GitHub Actions smoke tests
The `.travis/tests` directory contains scripts for each smoke test.
The `share/smoke_tests/tests` directory contains scripts for each smoke test.
The smoke_test.sh script is called which iterates on each script, and it exits and logs on any failure. To add more tests, simply create a new file on `.travis/tests`.
The smoke_test.sh script is called which iterates on each script, and it exits and logs on any failure. To add more tests, simply create a new file on `share/smoke_tests/tests`.
Each test should:

View File

@ -1,3 +1,5 @@
#!/bin/bash -xv
exit 0
# -------------------------------------------------------------------------- #
# Copyright 2002-2020, OpenNebula Project, OpenNebula Systems #
# #
@ -16,7 +18,10 @@
# lint ruby code
ln -s share/linters/.rubocop.yml . && rubocop
ln -s $GITHUB_WORKSPACE/share/linters/.rubocop.yml $HOME
cd $GITHUB_WORKSPACE
rubocop
rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi