diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 00000000..3f6d4a1b --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,100 @@ +name: Check + +on: + pull_request: + branches: [ "master" ] + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'ruby' ] + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + + - name: Autobuild + uses: github/codeql-action/autobuild@v2 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 + + rspec: + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Update Ubuntu package repository + run: sudo apt-get update + - name: Setup sqlite-devel + run: sudo apt-get -y install libsqlite3-dev + - name: Setup libcurl-devel + run: sudo apt-get -y install libcurl4 libcurl3-gnutls libcurl4-openssl-dev + + - name: Set up Ruby 3.1.4 + uses: ruby/setup-ruby@v1 + with: + ruby-version: 3.1.4 + bundler-cache: false + + - name: Install dependencies + run: bundle install + + - name: RSpec run + run: bundle exec rspec + + rubocop: + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Update Ubuntu package repository + run: sudo apt-get update + - name: Setup sqlite-devel + run: sudo apt-get -y install libsqlite3-dev + - name: Setup libcurl-devel + run: sudo apt-get -y install libcurl4 libcurl3-gnutls libcurl4-openssl-dev + + - name: Set up Ruby 3.1.4 + uses: ruby/setup-ruby@v1 + with: + ruby-version: 3.1.4 + bundler-cache: false + + - name: Install dependencies + run: bundle install + + - name: RuboCop run + run: | + bash -c " + bundle exec rubocop --require code_scanning --format CodeScanning::SarifFormatter -o rubocop.sarif + [[ $? -ne 2 ]] + " + + - name: Upload Sarif output + uses: github/codeql-action/upload-sarif@v2 + with: + sarif_file: rubocop.sarif diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index b116103f..00000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: "CodeQL" - -on: - pull_request: - branches: [ "master" ] - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: [ 'ruby' ] - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: ${{ matrix.language }} - - - name: Autobuild - uses: github/codeql-action/autobuild@v2 - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/rspec.yml b/.github/workflows/rspec.yml deleted file mode 100644 index 5cb93b5d..00000000 --- a/.github/workflows/rspec.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: RSpec - -on: - pull_request: - branches: [ "master" ] - -jobs: - rspec: - runs-on: ubuntu-20.04 - strategy: - fail-fast: false - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Update Ubuntu package repository - run: sudo apt-get update - - name: Setup sqlite-devel - run: sudo apt-get -y install libsqlite3-dev - - name: Setup libcurl-devel - run: sudo apt-get -y install libcurl4 libcurl3-gnutls libcurl4-openssl-dev - - - name: Set up Ruby 3.1.4 - uses: ruby/setup-ruby@v1 - with: - ruby-version: 3.1.4 - bundler-cache: false - - - name: Install dependencies - run: bundle install - - - name: RSpec run - run: bundle exec rspec diff --git a/.github/workflows/rubocop.yml b/.github/workflows/rubocop.yml deleted file mode 100644 index 4407694d..00000000 --- a/.github/workflows/rubocop.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: RuboCop - -on: - pull_request: - branches: [ "master" ] - -jobs: - rubocop: - runs-on: ubuntu-20.04 - strategy: - fail-fast: false - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Update Ubuntu package repository - run: sudo apt-get update - - name: Setup sqlite-devel - run: sudo apt-get -y install libsqlite3-dev - - name: Setup libcurl-devel - run: sudo apt-get -y install libcurl4 libcurl3-gnutls libcurl4-openssl-dev - - - name: Set up Ruby 3.1.4 - uses: ruby/setup-ruby@v1 - with: - ruby-version: 3.1.4 - bundler-cache: false - - - name: Install dependencies - run: bundle install - - - name: RuboCop run - run: | - bash -c " - bundle exec rubocop --require code_scanning --format CodeScanning::SarifFormatter -o rubocop.sarif - [[ $? -ne 2 ]] - " - - - name: Upload Sarif output - uses: github/codeql-action/upload-sarif@v2 - with: - sarif_file: rubocop.sarif diff --git a/README.md b/README.md index f3d0642e..1d947ace 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # AutoHCK -[![CircleCI](https://circleci.com/gh/HCK-CI/AutoHCK.svg?style=svg)](https://circleci.com/gh/HCK-CI/AutoHCK) +[![GitHub Actions](https://github.com/HCK-CI/AutoHCK/actions/workflows/check.yml/badge.svg)](https://github.com/HCK-CI/AutoHCK/actions) AutoHCK is a tool for automating HCK/HLK test suites used for WHQL certification, doing all the boilerplate steps in the process leaving you with simply choosing which driver you want to test on what OS.