Skip to content

Commit

Permalink
Let's race!
Browse files Browse the repository at this point in the history
Is uploading/downloading the built image any faster?
  • Loading branch information
mec committed Nov 13, 2024
1 parent 19006d0 commit 277fc1d
Showing 1 changed file with 62 additions and 6 deletions.
68 changes: 62 additions & 6 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,21 @@ jobs:
build-args: RAILS_ENV=test
push: false
tags: app_test:latest
outputs: type=docker, dest=/tmp
cache-from: type=gha
cache-to: type=gha,mode=min
-
name: Upload built image
uses: actions/upload-artifact@v4
with:
name: app_image
path: /tmp/app_image.tar

lint-and-format:
name: Linting and format application
runs-on: ubuntu-latest
needs: build-and-cache
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand All @@ -63,14 +67,30 @@ jobs:
yarn run lint:css && \
yarn run lint:format"
lint-and-format-download:
name: Linting and format application [download]
runs-on: ubuntu-latest
needs: build-and-cache
steps:
-
name: Download built image
uses: actions/download-artifact@v4
with:
name: app_image
path: /tmp
-
name: Run linters and formatters
run: |
docker run --rm app_test:latest /bin/bash -c "bundle exec standardrb -f simple && \
yarn run lint:js && \
yarn run lint:css && \
yarn run lint:format"
static-analysis:
name: Static analysis
runs-on: ubuntu-latest
needs: build-and-cache
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand All @@ -91,6 +111,22 @@ jobs:
run: |
docker run --rm app_test:latest /bin/bash -c "bundle exec brakeman -o /dev/stdout"
static-analysis-download:
name: Static analysis [download]
runs-on: ubuntu-latest
needs: build-and-cache
steps:
-
name: Download built image
uses: actions/download-artifact@v4
with:
name: app_image
path: /tmp
-
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
Expand Down Expand Up @@ -123,6 +159,26 @@ jobs:
name: Shutdown containers
run: docker compose -p app_test down && docker compose -p app_test rm

specs-download:
name: Specs and coverage [download]
runs-on: ubuntu-latest
needs: build-and-cache
steps:
-
name: Download built image
uses: actions/download-artifact@v4
with:
name: app_image
path: /tmp
-
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
Expand Down

0 comments on commit 277fc1d

Please sign in to comment.