forked from art049/fastapi-odmantic-realworld-example
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
110 additions
and
19 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# .github/workflows/ci.yml | ||
|
||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- ci/earthly | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
env: | ||
FORCE_COLOR: 1 | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKER_HUB_USERNAME }} | ||
password: ${{ secrets.DOCKER_HUB_PASSWORD }} | ||
|
||
- name: Install asdf | ||
uses: asdf-vm/actions/[email protected] | ||
|
||
- name: Install asdf plugins & packages | ||
run: | | ||
asdf plugin add earthly https://github.com/YR-ZR0/asdf-earthly | ||
asdf plugin update --all | ||
asdf install | ||
- name: Put back the git branch into git (Earthly uses it for tagging) | ||
run: | | ||
branch="" | ||
if [ -n "$GITHUB_HEAD_REF" ]; then | ||
branch="$GITHUB_HEAD_REF" | ||
else | ||
branch="${GITHUB_REF##*/}" | ||
fi | ||
git checkout -b "$branch" || true | ||
- name: Earthly version | ||
run: earthly --version | ||
|
||
- name: Run build | ||
run: make ci |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
earthly 0.7.21 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
VERSION 0.7 | ||
FROM earthly/dind:alpine-3.18-docker-23.0.6-r4 | ||
WORKDIR /app | ||
|
||
deps: | ||
FROM DOCKERFILE --target "base" . | ||
|
||
dev: | ||
FROM DOCKERFILE --target "dev" . | ||
|
||
prod: | ||
FROM DOCKERFILE --target "prod" . | ||
|
||
lint: | ||
FROM +dev | ||
RUN bash scripts/lint.sh | ||
|
||
format: | ||
FROM +dev | ||
RUN bash scripts/format.sh | ||
|
||
# FIXME: we don't mount .git files in containers, so this doesn't work | ||
# pre-commit: | ||
# FROM +dev | ||
# RUN bash scripts/pre-commit.sh | ||
|
||
unit-tests: | ||
FROM +dev | ||
RUN bash scripts/unit-tests.sh | ||
|
||
coverage: | ||
FROM +dev | ||
RUN bash scripts/coverage.sh | ||
|
||
functional-tests: | ||
FROM +dev | ||
COPY docker-compose.yaml . | ||
WITH DOCKER \ | ||
--compose docker-compose.yaml \ | ||
--load webofmars/cicdparadox:earthly-latest=+prod \ | ||
--load webofmars/cicdparadox:earthly-develop=+dev \ | ||
--service mongo --service api | ||
RUN bash scripts/functional-tests.sh | ||
END |
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
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
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