-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tools: Migrate from CircleCi to GitHub Actions (#679)
- Resolves #570 - Description: * Moves all our CircleCi workflows to GitHub Actions (Change Detection, Test Runs). * Change detection will only run in [PRs] or [pushes to tags, master, or develop]. * Change detection for GitHub Action Workflow needed explicit private and public ssh keys (generated and added the corresponding keys to secret section, and deploy key sections), there is an authentication step that takes care of the SSH authentication for that workflow. * Added a new Workflow to build defradb binary and call `defradb start` on it to ensure the start up command doesn't crash. * Removed CircleCi config file validation tool.
- Loading branch information
1 parent
0bc2a07
commit 3973c2d
Showing
7 changed files
with
150 additions
and
117 deletions.
There are no files selected for viewing
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,48 @@ | ||
name: Detect Change Workflow | ||
|
||
on: | ||
pull_request: | ||
|
||
push: | ||
tags: | ||
- v* | ||
branches: | ||
- master | ||
- develop | ||
|
||
jobs: | ||
detect-change: | ||
name: Detect change job | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code into the directory | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Go environment explicitly | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: "1.17" | ||
check-latest: true | ||
|
||
- name: Build dependencies | ||
run: | | ||
make deps:modules | ||
make deps:test | ||
# We need SSH Authorization because change detection needs use `ls-remote` like: | ||
# git ls-remote [email protected]:sourcenetwork/defradb.git refs/heads/develop | ||
- uses: webfactory/[email protected] | ||
with: | ||
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | ||
|
||
- name: Run detection for changes | ||
run: make test:changes | ||
|
||
## Uncomment to enable ability to SSH into the runner. | ||
#- name: Setup upterm ssh session for debugging | ||
# uses: lhotari/action-upterm@v1 | ||
# with: | ||
# limit-access-to-actor: true | ||
# limit-access-to-users: shahzadlone |
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,27 @@ | ||
name: Run Tests Workflow | ||
|
||
on: [push] | ||
|
||
jobs: | ||
run-tests: | ||
name: Run tests job | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code into the directory | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Go environment explicitly | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: "1.17" | ||
check-latest: true | ||
|
||
- name: Build dependencies | ||
run: | | ||
make deps:modules | ||
make deps:test | ||
- name: Run the tests, showing name of each test | ||
run: make test:names |
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,50 @@ | ||
name: Start Binary Workflow | ||
|
||
on: | ||
pull_request: | ||
|
||
push: | ||
tags: | ||
- v* | ||
branches: | ||
- master | ||
- develop | ||
|
||
jobs: | ||
start-binary: | ||
name: Start binary job | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
- name: Checkout code into the directory | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Go environment explicitly | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: "1.17" | ||
check-latest: true | ||
|
||
- name: Build modules | ||
run: make deps:modules | ||
|
||
- name: Build binary | ||
run: make build | ||
|
||
- name: Attempt to start binary | ||
run: | | ||
./build/defradb start & | ||
sleep 5 | ||
- name: Check if binary is still running | ||
run: | | ||
FOUND=$(pgrep -c "defradb"); | ||
echo "Process(es) we found = [${FOUND}]"; | ||
if [[ ${FOUND} == 0 ]]; then | ||
echo "DefraDB start command failed."; | ||
exit 1; | ||
else | ||
echo "DefraDB running."; | ||
fi |
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