|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + pull_request: |
| 6 | + schedule: |
| 7 | + # * is a special character in YAML so you have to quote this string |
| 8 | + - cron: '0 0 * * 1' |
| 9 | + |
| 10 | +jobs: |
| 11 | + build: |
| 12 | + runs-on: ${{ matrix.os }} |
| 13 | + strategy: |
| 14 | + fail-fast: false |
| 15 | + matrix: |
| 16 | + os: [ubuntu-latest, windows-latest, macos-latest] |
| 17 | + oscript_version: ['1.2.0', 'dev', 'stable'] |
| 18 | + |
| 19 | + steps: |
| 20 | + - uses: actions/checkout@v2 |
| 21 | + |
| 22 | + - name: Setup Onescript Action |
| 23 | + |
| 24 | + with: |
| 25 | + version: ${{ matrix.oscript_version }} |
| 26 | + |
| 27 | + - name: Install dependencies |
| 28 | + run: | |
| 29 | + |
| 30 | + opm install 1testrunner; |
| 31 | + opm install 1bdd; |
| 32 | + opm install coverage; |
| 33 | + opm install -l --dev |
| 34 | +
|
| 35 | + - name: Compute branch name |
| 36 | + |
| 37 | + |
| 38 | + - name: Run tests |
| 39 | + run: | |
| 40 | + oscript ./tasks/coverage.os |
| 41 | +
|
| 42 | + - name: SonarCloud Scan on push |
| 43 | + if: github.repository == 'oscript-library/opm' && github.event_name == 'push' && matrix.os == 'ubuntu-latest' && matrix.oscript_version == 'dev' |
| 44 | + |
| 45 | + env: |
| 46 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 47 | + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |
| 48 | + with: |
| 49 | + args: > |
| 50 | + -Dsonar.host.url=https://sonar.openbsl.ru |
| 51 | + -Dsonar.branch.name=${{ env.BRANCH_NAME }} |
| 52 | + |
| 53 | + - name: SonarCloud Scan on PR |
| 54 | + if: github.repository == 'oscript-library/opm' && github.event_name == 'pull_request' && matrix.os == 'ubuntu-latest' && matrix.oscript_version == 'dev' |
| 55 | + |
| 56 | + env: |
| 57 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 58 | + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |
| 59 | + with: |
| 60 | + args: > |
| 61 | + -Dsonar.host.url=https://sonar.openbsl.ru |
| 62 | + -Dsonar.pullrequest.key=${{ github.event.pull_request.number }} |
| 63 | + -Dsonar.pullrequest.branch=${{ github.event.pull_request.head.ref }} |
| 64 | + -Dsonar.pullrequest.base=${{ github.event.pull_request.base.ref }} |
| 65 | + -Dsonar.scm.revision=${{ github.event.pull_request.head.sha }} |
0 commit comments