Improved caching with Docker in CI #2293
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
# TODO: Enable GitHub Actions on the repository to test all pull requests | |
# https://github.com/<org>/<repo>/actions | |
name: CI Checks | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
- develop | |
jobs: | |
lint-and-format: | |
name: Linting and format application | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@v4 | |
- | |
name: Load cache | |
uses: ./.github/actions/continuous-integration/load-cache | |
- | |
name: Run Ruby standard | |
run: | | |
docker run --rm app_test:latest /bin/bash -c "bundle exec standardrb -f simple" | |
- | |
name: Run ESLint | |
run: yarn run lint:js | |
- | |
name: Run Stylelint | |
run: yarn run lint:css | |
- | |
name: Run Prettier | |
run: yarn run lint:format | |
static-analysis: | |
name: Static analysis | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@v4 | |
- | |
name: Load cache | |
uses: ./.github/actions/continuous-integration/load-cache | |
- | |
name: Run Brakeman | |
run: | | |
docker run --rm app_test:latest /bin/bash -c "bundle exec brakeman -o /dev/stdout" | |
specs: | |
name: Specs and coverage | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@v4 | |
- | |
name: Load cache | |
uses: ./.github/actions/continuous-integration/load-cache | |
- | |
name: Run RSpec and Simplecov | |
run: | | |
docker compose -p complete-app -f docker-compose.ci.yml \ | |
run --name app_test test /bin/bash -c "bin/rails spec" | |
- | |
name: Shutdown containers | |
run: docker compose -p app_test down && docker compose -p app_test rm | |
shellcheck: | |
name: Linting scripts | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@v4 | |
- | |
name: Run Shellceck | |
run: | | |
for file in $(git ls-files script/*) | |
do shellcheck -x "$file" | |
done |