-
Notifications
You must be signed in to change notification settings - Fork 0
VID-10459: Replace GitLab CI pipeline with GitHub Actions #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
znorris
wants to merge
3
commits into
main
Choose a base branch
from
vid-10459-refactor-pug-client-ruby-gitlab-workflow-to-github-actions
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+164
−75
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,90 @@ | ||
| name: CI | ||
|
|
||
| # Note the coverage gap: a commit pushed to a branch with no pull request open | ||
| # yet matches neither trigger, so it runs no CI until the PR exists. | ||
| on: | ||
| pull_request: | ||
| push: | ||
| branches: | ||
| - main | ||
|
|
||
| concurrency: | ||
| group: ci-${{ github.head_ref || github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| # A container image rather than ruby/setup-ruby: this repo's Actions policy | ||
| # is allowed_actions: "selected" and ruby/setup-ruby is not on the | ||
| # allow-list. Pulling a plain image needs no allow-listing. Pinned to the | ||
| # patch version in .ruby-version. | ||
| container: | ||
| image: ruby:3.4.5 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: actions/cache@v4 | ||
| with: | ||
| path: vendor/bundle | ||
| key: bundle-${{ hashFiles('Gemfile.lock') }} | ||
| restore-keys: bundle- | ||
|
|
||
| - name: bundle install | ||
| run: | | ||
| ruby -v | ||
| gem install bundler --no-document | ||
| bundle config set --local path 'vendor/bundle' | ||
| bundle install --jobs "$(nproc)" | ||
|
|
||
| - name: rspec | ||
| run: bundle exec rspec --format documentation --format RspecJunitFormatter --out rspec.xml | ||
|
|
||
| - name: Upload test report | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: rspec-report | ||
| path: rspec.xml | ||
| retention-days: 7 | ||
| if-no-files-found: warn | ||
|
|
||
| lint: | ||
| runs-on: ubuntu-latest | ||
| container: | ||
| image: ruby:3.4.5 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: actions/cache@v4 | ||
| with: | ||
| path: vendor/bundle | ||
| key: bundle-${{ hashFiles('Gemfile.lock') }} | ||
| restore-keys: bundle- | ||
|
|
||
| - name: bundle install | ||
| run: | | ||
| ruby -v | ||
| gem install bundler --no-document | ||
| bundle config set --local path 'vendor/bundle' | ||
| bundle install --jobs "$(nproc)" | ||
|
|
||
| # Non-blocking: .rubocop.yml is empty, so the full default cop set runs | ||
| # against code that predates RuboCop being turned on. It currently reports | ||
| # 166 offenses across 69 files and exits 1. The step shows as failed in the | ||
| # Checks UI while the job stays green. | ||
| - name: rubocop | ||
| continue-on-error: true | ||
| run: bundle exec rubocop --format progress --format junit --out rubocop.xml | ||
|
|
||
| - name: Upload lint report | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: rubocop-report | ||
| path: rubocop.xml | ||
| retention-days: 7 | ||
| if-no-files-found: warn |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| name: Pages | ||
|
|
||
| # Requires GitHub Pages to be enabled for the repo with Source: GitHub Actions. | ||
| # actions/deploy-pages calls the Pages Deployments API, which needs a site | ||
| # already provisioned with build_type=workflow; the action cannot create one, so | ||
| # until an admin does this once the deploy job fails. | ||
| # | ||
| # Triggered on CI completing rather than on push, so docs are only published for | ||
| # a commit whose tests passed. | ||
| on: | ||
| workflow_run: | ||
| workflows: ["CI"] | ||
| types: [completed] | ||
| branches: [main] | ||
|
|
||
| # One deployment at a time, queued rather than cancelled, so an in-flight | ||
| # deploy-pages call is never killed mid-upload. | ||
| concurrency: | ||
| group: pages | ||
| cancel-in-progress: false | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| build: | ||
| if: github.event.workflow_run.conclusion == 'success' | ||
| runs-on: ubuntu-latest | ||
| # Container image for the same reason as ci.yml: ruby/setup-ruby is not on | ||
| # this repo's selected-actions allow-list. | ||
| container: | ||
| image: ruby:3.4.5 | ||
| steps: | ||
| # workflow_run checks out the default branch by default, which would build | ||
| # stale docs if main moved while CI was running. Pin to the commit CI | ||
| # actually tested. | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| ref: ${{ github.event.workflow_run.head_sha }} | ||
|
|
||
| - uses: actions/cache@v4 | ||
| with: | ||
| path: vendor/bundle | ||
| key: bundle-${{ hashFiles('Gemfile.lock') }} | ||
| restore-keys: bundle- | ||
|
|
||
| - name: bundle install | ||
| run: | | ||
| gem install bundler --no-document | ||
| bundle config set --local path 'vendor/bundle' | ||
| bundle install --jobs "$(nproc)" | ||
|
|
||
| - name: Generate YARD docs | ||
| run: bundle exec yard doc | ||
|
|
||
| - uses: actions/upload-pages-artifact@v3 | ||
| with: | ||
| path: doc | ||
|
|
||
| deploy: | ||
| needs: build | ||
| runs-on: ubuntu-latest | ||
| # Scoped to this job so that build, which runs bundle install against a | ||
| # lockfile-resolved dependency tree, never holds the ability to call the | ||
| # Pages Deployments API or mint an OIDC token for this repo. | ||
| permissions: | ||
| pages: write | ||
| id-token: write | ||
| environment: | ||
| name: github-pages | ||
| url: ${{ steps.deployment.outputs.page_url }} | ||
| steps: | ||
| - id: deployment | ||
| uses: actions/deploy-pages@v4 | ||
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These pages will be publicly accessibly. That won't leak any secrets. When we come up with something private, we'll move it over.