diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml new file mode 100644 index 000000000..772962d85 --- /dev/null +++ b/.github/workflows/copilot-setup-steps.yml @@ -0,0 +1,49 @@ +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 + + echo "Running test suite..." + bundle exec rake test \ No newline at end of file diff --git a/db/seeds.rb b/db/seeds.rb index 4527740e8..ce7c0f3df 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -451,4 +451,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 diff --git a/yarn.lock b/yarn.lock index bf8c57d14..ba9c83469 100644 --- a/yarn.lock +++ b/yarn.lock @@ -815,9 +815,9 @@ camelcase-css@^2.0.1: integrity sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA== caniuse-lite@^1.0.30001688, caniuse-lite@^1.0.30001702: - version "1.0.30001707" - resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001707.tgz" - integrity sha512-3qtRjw/HQSMlDWf+X79N206fepf4SOOU6SQLMaq/0KkZLmSjPxAkBOQQ+FxbHKfHmYLZFfdWsO3KA90ceHPSnw== + version "1.0.30001759" + resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001759.tgz" + integrity sha512-Pzfx9fOKoKvevQf8oCXoyNRQ5QyxJj+3O0Rqx2V5oxT61KGx8+n6hV/IUyJeifUci2clnmmKVpvtiqRzgiWjSw== chalk@^4.0.0: version "4.1.2"