Useful actions shared between our repositories.
Run bundle update
against a repository and create a pull request with any changes.
checkout-key
: the SSH key to use to check out the repository. Details of setting up this key can be found in the wiki.container
(optional): Run in a container with ruby already initialised.working-directory
(optional): the working directory where Gemfile can be found. Defaults to the repository root.
name: Bundle Update
on:
schedule:
- cron: '0 7 * * THU'
workflow_dispatch:
jobs:
bundle-update:
name: Run bundle update
runs-on: [ self-hosted, linux, x64 ]
container: docker://ghcr.io/university-of-york/faculty-dev-docker-images/ci/aws-lambda-ruby-dev:2.7
steps:
- uses: university-of-york/faculty-dev-actions/bundle-update@v1
with:
checkout-key: ${{ secrets.BUNDLE_UPDATE_SSH_PRIVATE_KEY }}
container: "true"
Run bundle update --group development test
against a repository and auto-merge the pull request with any changes.
checkout-key
: the SSH key to use to check out the repository. Details of setting up this key can be found in the wiki.container
(optional): Run in a container with ruby already initialised.github-token
: the token used in the workflow to allow the PR to be updated and auto-merged.working-directory
(optional): the working directory where Gemfile can be found. Defaults to the repository root.
name: Bundle Update [development, test]
on:
schedule:
- cron: '0 6 * * *'
workflow_dispatch:
permissions:
pull-requests: write
contents: write
jobs:
bundle-update:
name: Run `bundle update --group development test` and auto-merge
runs-on: [ self-hosted, linux, x64 ]
container: docker://ghcr.io/university-of-york/faculty-dev-docker-images/ci/aws-lambda-ruby-dev:2.7
steps:
- uses: university-of-york/faculty-dev-actions/bundle-update-dev-container@v1
with:
checkout-key: ${{ secrets.BUNDLE_UPDATE_SSH_PRIVATE_KEY }}
container: "true"
github-token: ${{ secrets.GITHUB_TOKEN }}
Run bundle exec bundler-audit check --update
against a repository.
working-directory
(optional): the working directory where Gemfile can be found. Defaults to the repository root.
jobs:
bundler-audit:
name: Bundler Audit
runs-on: ubuntu-latest
steps:
- uses: university-of-york/faculty-dev-actions/bundler-audit@v1
Deploys the named gem to gemfury
gem-name
: the name of the gem to buildgemfury-push-token
: the token used to authenticate with gemfuryprerelease-only
(optional): set to anything other than "false" to only upload prerelease versionsworking-directory
(optional): the working directory where Gemfile can be found. Defaults to the repository root.
jobs:
gemfury-deploy:
name: Gemfury Deployment
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: university-of-york/faculty-dev-actions/gemfury-deployment@v1
with:
gem-name: uoy-faculty-new_gem
gemfury-push-token: ${{ secrets.GEMFURY_PUSH_TOKEN }}
Runs npm update
on a runner against a repository and create a pull request with any changes.
checkout-key
: the SSH key to use to check out the repository. Details of setting up this key can be found in the wiki.node-version
(optional): the version of node to use. Defaults to 14.working-directory
(optional): the working directory where Gemfile can be found. Defaults to the repository root.
Run rspec
tests in the AWS lambda environment.
artifact-name
(optional): the name of the vue artifact to download.
This is an example with a postgres database available for tests.
jobs:
rspec:
name: RSpec tests
runs-on: [ self-hosted, linux, x64 ]
container: docker://ghcr.io/university-of-york/faculty-dev-docker-images/ci/aws-lambda-ruby-dev:2.7
services:
postgres:
image: ghcr.io/university-of-york/faculty-dev-db-pristine:latest
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: university-of-york/faculty-dev-actions/rspec-lambda@v1
env:
DB_HOST: postgres
DB_USER: sinatra_base_app
As above, but expects the rspec-github-actions-summary
and rspec-github
gems to be installed to generate output for
github's reports.
Run rspec
tests on a runner.
working-directory
(optional): the working directory where Gemfile can be found. Defaults to the repository root.
As above, but expects the rspec-github-actions-summary
and rspec-github
gems to be installed to generate output for
github's reports.
Run rubocop
against a repository.
working-directory
(optional): the working directory where Gemfile can be found. Defaults to the repository root.
jobs:
rubocop:
name: Rubocop
runs-on: ubuntu-latest
steps:
- uses: university-of-york/faculty-dev-actions/rubocop@v1
Build Vue components and upload them as an artifact named vue-components
node-version
(optional): the version of node to use. Defaults to 14.working-directory
(optional): the working directory where Gemfile can be found. Defaults to the repository root.
jobs:
vue-build:
name: Build Vue components
runs-on: ubuntu-latest
steps:
- uses: university-of-york/faculty-dev-actions/vue-build@v1