-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from cdalvaro/feat/migrate_from_circleci_to_gi…
…thub_actions Migrate from CircleCI to GitHub Actions
- Loading branch information
Showing
4 changed files
with
98 additions
and
214 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
github: cdalvaro |
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,18 @@ | ||
# Number of days of inactivity before an issue becomes stale | ||
daysUntilStale: 60 | ||
# Number of days of inactivity before a stale issue is closed | ||
daysUntilClose: 7 | ||
# Issues with these labels will never be considered stale | ||
exemptLabels: | ||
- pinned | ||
- security | ||
- keep-alive | ||
# Label to use when marking an issue as stale | ||
staleLabel: stale | ||
# Comment to post when marking an issue as stale. Set to `false` to disable | ||
markComment: > | ||
This issue has been automatically marked as stale because it has not had | ||
recent activity. It will be closed if no further activity occurs. Thank you | ||
for your contributions. | ||
# Comment to post when closing a stale issue. Set to `false` to disable | ||
closeComment: false |
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,79 @@ | ||
name: Build and test | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
env: | ||
REGISTRY: docker.io | ||
IMAGE_NAME: cdalvaro/saltstack-master | ||
IMAGE_TAG: ci | ||
GITHUB_REF_NAME: ${{ github.event.release.tag_name }} | ||
|
||
jobs: | ||
build: | ||
name: Build Docker image | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 45 | ||
steps: | ||
- name: Set env variables | ||
run: | | ||
echo ::set-env name=CACHE_FROM::"${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest" | ||
echo ::set-env name=DOCKER_IMAGE::"${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}" | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Cache lastest image | ||
run: docker pull ${CACHE_FROM} | ||
|
||
- name: Build Docker image | ||
run: | | ||
docker build \ | ||
--build-arg VCS_REF=${GITHUB_REF_NAME:-${GITHUB_SHA}} \ | ||
--build-arg BUILD_DATE="$(date +"%Y-%m-%d %H:%M:%S%:z")" \ | ||
--cache-from ${CACHE_FROM} \ | ||
--tag ${DOCKER_IMAGE} . | ||
- name: Save docker image | ||
run: | | ||
mkdir -p docker/ | ||
docker save -o docker/docker-image.tar ${DOCKER_IMAGE} | ||
- name: Upload image for test job | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: docker-image | ||
path: docker/docker-image.tar | ||
|
||
test: | ||
name: Test Docker image | ||
needs: build | ||
runs-on: ubuntu-latest | ||
env: | ||
CONTAINER_NAME: salt_master_ci | ||
steps: | ||
- name: Download docker image from build job | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: docker-image | ||
path: docker/ | ||
|
||
- name: Load docker image from build job | ||
run: docker load -i docker/docker-image.tar | ||
|
||
- name: Launch docker container | ||
run: docker run --rm -d --name "${CONTAINER_NAME}" "${IMAGE_NAME}:${IMAGE_TAG}" | ||
|
||
- name: Show container info | ||
run: docker container ls | ||
|
||
- name: Wait for salt-master bootup | ||
run: sleep 60 | ||
|
||
- name: Show salt versions | ||
run: docker exec "${CONTAINER_NAME}" salt --versions | ||
|
||
- name: Test image calling healthcheck | ||
run: docker exec "${CONTAINER_NAME}" /usr/local/sbin/healthcheck |