diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index c600428c..c9686c63 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1 @@ -softservedata +@softservedata diff --git a/.github/tests/Gemfile b/.github/tests/Gemfile index d2403f18..c16d2dde 100644 --- a/.github/tests/Gemfile +++ b/.github/tests/Gemfile @@ -1,5 +1,8 @@ # frozen_string_literal: true +# Gemfile source "https://rubygems.org" +gem "rspec" + # gem "rails" diff --git a/.github/workflows/blank.yml b/.github/workflows/blank.yml new file mode 100644 index 00000000..2ed4e2a4 --- /dev/null +++ b/.github/workflows/blank.yml @@ -0,0 +1,36 @@ +# This is a basic workflow to help you get started with Actions + +name: CI + +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events but only for the "develop" branch + push: + branches: [ "develop" ] + pull_request: + branches: [ "develop" ] + + # 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: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v4 + + # Runs a single command using the runners shell + - name: Run a one-line script + run: echo Hello, world! + + # Runs a set of commands using the runners shell + - name: Run a multi-line script + run: | + echo Add other actions to build, + echo test, and deploy your project. diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 31cda7e6..24d06a7a 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -1,64 +1,33 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - -# GitHub recommends pinning actions to a commit SHA. -# To get a newer version, you will need to update the SHA. -# You can also reference a tag or branch, but the action may change without warning. - -name: Ruby - -env: - SECRETS_TOKEN: ${{ secrets.PAT }} +name: CI Pipeline on: push: - branches: [ main, develop ] + branches: + - main pull_request: - branches: [ main, develop ] - workflow_dispatch: + branches: + - main jobs: test: runs-on: ubuntu-latest - + steps: - - name: Install my-app token - id: my-app - uses: getsentry/action-github-app-token@v3 - with: - app_id: ${{ secrets.APP_ID }} - private_key: ${{ secrets.APP_PRIVATE_KEY }} - - uses: actions/checkout@v4 - - name: Add outside users to organization - run: | - users=$(curl -L -s \ - -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer ${{ steps.my-app.outputs.token }}" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - https://api.github.com/repos/${{ github.repository_owner }}/${{ github.event.repository.name }}/collaborators?affiliation=outside \ - | jq '.[] .id') - for user in $users - do - curl -s -L -o /dev/null \ - -X POST \ - -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer ${{ steps.my-app.outputs.token }}" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - https://api.github.com/orgs/${{ github.repository_owner }}/invitations \ - -d "{\"invitee_id\": $user}" - done + - name: Checkout code + uses: actions/checkout@v4 + + - name: Authenticate with PAT + env: + GITHUB_TOKEN: ${{ secrets.PAT }} + run: echo "Authenticated using PAT" + - name: Set up Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: '3.2' - working-directory: '.github/tests' - bundler-cache: true + ruby-version: 3.2 + + - name: Install dependencies + run: bundle install + - name: Run tests - env: - URL: ${{ github.repository }} - TOKEN: ${{ steps.my-app.outputs.token }} - working-directory: '.github/tests' - run: - ruby test/script_test.rb + run: bundle exec rspec