Checks #287
Workflow file for this run
This file contains 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
name: Checks | |
on: # yamllint disable-line rule:truthy | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
schedule: | |
- cron: 0 20 * * * | |
workflow_dispatch: | |
inputs: | |
bleeding_edge: | |
type: boolean | |
default: false | |
permissions: | |
contents: read | |
env: | |
BLEEDING_EDGE: "${{ (inputs.bleeding_edge == true || github.event_name == 'schedule') && 'true' || 'false' }}" | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- if: env.BLEEDING_EDGE == 'true' | |
uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true | |
- if: env.BLEEDING_EDGE == 'true' | |
name: Unfreeze bundler | |
run: bundle config --local deployment false | |
- if: env.BLEEDING_EDGE == 'true' | |
name: "Use git gem sources" | |
run: bundle exec ruby .github/bleeding_edge.rb && bundle lock && cat Gemfile.lock | |
- name: Build | |
uses: docker/build-push-action@v5 | |
with: | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
load: true | |
tags: foxtrove | |
build-args: | | |
BASE_IMAGE=${{ env.BLEEDING_EDGE == 'true' && 'ghcr.io/docker-ruby-nightly/ruby:alpine3.20-nightly' || ''}} | |
- name: Set env file | |
run: | | |
cat <<EOT >> .env | |
FOXTROVE_DATA_PATH=${{ runner.temp }}/foxtrove | |
EOT | |
- name: Create DB | |
run: docker compose run foxtrove bin/setup | |
- name: Run Tests | |
run: docker compose run -e CI=1 tests | |
- name: Upload Coverage | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
rubocop: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true | |
- if: env.BLEEDING_EDGE == 'false' | |
name: Run Rubocop | |
run: bundle exec rubocop --format github | |
docker-checks: | |
runs-on: ubuntu-latest | |
name: Run ${{ matrix.service }} | |
strategy: | |
fail-fast: false | |
matrix: | |
service: [yamllint, csslint, tslint] | |
steps: | |
- uses: actions/checkout@v4 | |
- if: env.BLEEDING_EDGE == 'false' | |
name: Run ${{ matrix.service }} | |
run: docker compose run ${{ matrix.service }} |