Skip to content

CI

CI #101

Workflow file for this run

name: CI
on:
push:
pull_request:
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '0 0 * * 1'
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
oscript_version: ['stable', '1.8.4']
steps:
- uses: actions/checkout@v2
- name: Setup Onescript Action
uses: otymko/setup-onescript@v1.1
with:
version: ${{ matrix.oscript_version }}
- name: Install dependencies
run: |
opm install opm
opm install 1testrunner;
opm install 1bdd;
opm install coverage;
opm install -l --dev
- name: Compute branch name
uses: nelonoel/branch-name@v1.0.1
- name: Run tests
run: |
oscript ./tasks/coverage.os
- name: SonarCloud Scan on push
if: github.repository == 'oscript-library/opm' && github.event_name == 'push' && matrix.os == 'ubuntu-latest' && matrix.oscript_version == 'stable'
uses: nixel2007/sonarcloud-github-action@v1.4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: >
-Dsonar.host.url=https://sonar.openbsl.ru
-Dsonar.branch.name=${{ env.BRANCH_NAME }}
- name: SonarCloud Scan on PR
if: github.repository == 'oscript-library/opm' && github.event_name == 'pull_request' && matrix.os == 'ubuntu-latest' && matrix.oscript_version == 'stable'
uses: nixel2007/sonarcloud-github-action@v1.4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: >
-Dsonar.host.url=https://sonar.openbsl.ru
-Dsonar.pullrequest.key=${{ github.event.pull_request.number }}
-Dsonar.pullrequest.branch=${{ github.event.pull_request.head.ref }}
-Dsonar.pullrequest.base=${{ github.event.pull_request.base.ref }}
-Dsonar.scm.revision=${{ github.event.pull_request.head.sha }}