This repository has been archived by the owner on Sep 13, 2021. It is now read-only.
-
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.
Convert CircleCI workflows into GH Actions
- Loading branch information
Showing
9 changed files
with
106 additions
and
83 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,21 @@ | ||
#!/bin/sh | ||
|
||
# CI runs this script to check that there are no extra merge commits | ||
# in the feature branch that is being merged, and that the branch was rebased | ||
# on top of the latest default branch. | ||
# More details: https://stackoverflow.com/q/64435110/9835872 | ||
|
||
head=$(git remote show origin | awk '/HEAD branch/ {print $NF}') | ||
current="$(git rev-parse HEAD)" | ||
|
||
if ! git merge-base --is-ancestor "origin/${head}" "$current"; then | ||
printf "Forgotten to rebase on top of %s.\nExiting with error!\n" "$head" | ||
exit 1 | ||
fi | ||
|
||
if [ "$(git rev-list --count --merges "origin/${head}..${current}")" -ne 0 ]; then | ||
printf "There are merge commits on the branch.\nExiting with error!\n" | ||
exit 1 | ||
fi | ||
|
||
echo Branch up-to-date and commits ok. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: "CI" | ||
on: pull_request | ||
jobs: | ||
build: | ||
name: "Build" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: "Checkout code" | ||
uses: actions/checkout@v2 | ||
with: | ||
# Checkout the current commit instead of the commit that would get | ||
# made when the PR would be merged, since we want to validate that | ||
# the branch doesn't contain any merge commits and is rebased correctly. | ||
# We also fetch all the objects here so that we can do the comparisons. | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
fetch-depth: 0 | ||
|
||
- name: "Check commits of the PR branch" | ||
run: ./.github/check_commits.sh | ||
|
||
- name: "Login to Dockerhub" | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: "Pull the image" | ||
# Avoid caching pull-only images,since pullign is faster than caching in most cases. | ||
run: docker-compose --file .github/docker-compose-ci.yml pull | ||
|
||
- name: "Setup Docker layer cache" | ||
uses: satackey/action-docker-layer-caching@v0.0.11 | ||
# Don't terminate if fetching from the cache fails. | ||
continue-on-error: true | ||
|
||
- name: "Build the image" | ||
run: docker-compose --file .github/docker-compose-ci.yml build | ||
|
||
- name: "Run linters, type-check, and tests" | ||
run: > | ||
docker-compose --file .github/docker-compose-ci.yml up --abort-on-container-exit | ||
&& docker cp backend-ci:/home/user/app/coverage.xml . | ||
- name: "Upload coverage to Codecov" | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
files: ./coverage.xml | ||
fail_ci_if_error: true |
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