diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml new file mode 100644 index 000000000..a0bd032bc --- /dev/null +++ b/.github/workflows/copilot-setup-steps.yml @@ -0,0 +1,46 @@ +name: Setup Development Environment for GitHub Copilot + + +# Automatically run the setup steps when they are changed to allow for easy validation, and +# allow manual testing through the repository's "Actions" tab +on: + workflow_dispatch: + push: + paths: + - .github/workflows/copilot-setup-steps.yml + pull_request: + paths: + - .github/workflows/copilot-setup-steps.yml + +jobs: + # The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot. + copilot-setup-steps: + runs-on: ubuntu-latest + + # Only let github read the repository contents + permissions: + contents: read + + steps: + - name: Checkout repository + uses: actions/checkout@v5 + with: + fetch-depth: 30 # Fetch past 30 commits, so reasonable amount of commit context is included + + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + + - name: Run bin/setup + run: bin/setup --skip-server + + - name: Validate setup + run: | + echo "Testing database connectivity..." + bundle exec rails runner \ + "puts 'Database connection: OK'; \ + puts 'User count: ' + User.count.to_s" + + echo "Running code style validation..." + bundle exec standardrb diff --git a/.gitignore b/.gitignore index 008a884f8..1fbcd2455 100644 --- a/.gitignore +++ b/.gitignore @@ -4,8 +4,9 @@ # or operating system, you probably want to add a global ignore instead: # git config --global core.excludesfile '~/.gitignore_global' -# Ignore bundler config. +# Ignore bundler config and cache /.bundle +vendor/bundle/ # Ignore all logfiles and tempfiles. /log/* diff --git a/db/seeds.rb b/db/seeds.rb index addc098ac..34da0051d 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -437,4 +437,8 @@ Rake::Task["backfill:speaker_participation"].invoke Rake::Task["backfill:event_involvements"].invoke Rake::Task["speakerdeck:set_usernames_from_slides_url"].invoke -Rake::Task["contributors:fetch"].invoke +begin + Rake::Task["contributors:fetch"].invoke +rescue ApplicationClient::Unauthorized => e + puts "Skipping fetching contributors: #{e.message}" +end