-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[tests] build a local gantry image to run container tests. Also used …
…it as images remover.
- Loading branch information
Showing
21 changed files
with
276 additions
and
204 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 |
---|---|---|
|
@@ -66,3 +66,26 @@ jobs: | |
run: | | ||
bash shellspec --pattern tests/${{ matrix.test_suit }} | ||
container_tests: | ||
name: Run container tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Docker Buildx | ||
uses: docker/[email protected] | ||
- name: Install shellspec | ||
run: | | ||
mkdir -p ~/shellspec | ||
cd ~/shellspec | ||
git clone https://github.com/shellspec/shellspec.git | ||
ln -s ~/shellspec/shellspec/shellspec /usr/local/bin/shellspec | ||
echo -n "shellspec version: " | ||
shellspec --version | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
- name: Run container tests | ||
run: | | ||
export GANTRY_TEST_CONTAINER=true | ||
export GANTRY_TEST_CONTAINER_REPO_TAG= | ||
echo "GANTRY_TEST_CONTAINER=${GANTRY_TEST_CONTAINER}" | ||
echo "GANTRY_TEST_CONTAINER_REPO_TAG=${GANTRY_TEST_CONTAINER_REPO_TAG}" | ||
bash shellspec --jobs 50 |
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 |
---|---|---|
|
@@ -67,17 +67,40 @@ jobs: | |
uses: actions/checkout@v4 | ||
- name: Run tests | ||
run: | | ||
export DOCKERHUB_PASSWORD=${{ secrets.DOCKERHUB_PASSWORD }} | ||
export DOCKERHUB_USERNAME=${{ secrets.DOCKERHUB_USERNAME }} | ||
bash shellspec --pattern tests/${{ matrix.test_suit }} | ||
container_tests: | ||
name: Run container tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Docker Buildx | ||
uses: docker/[email protected] | ||
- name: Install shellspec | ||
run: | | ||
mkdir -p ~/shellspec | ||
cd ~/shellspec | ||
git clone https://github.com/shellspec/shellspec.git | ||
ln -s ~/shellspec/shellspec/shellspec /usr/local/bin/shellspec | ||
echo -n "shellspec version: " | ||
shellspec --version | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
- name: Run container tests | ||
run: | | ||
export GANTRY_TEST_CONTAINER=true | ||
export GANTRY_TEST_CONTAINER_REPO_TAG= | ||
echo "GANTRY_TEST_CONTAINER=${GANTRY_TEST_CONTAINER}" | ||
echo "GANTRY_TEST_CONTAINER_REPO_TAG=${GANTRY_TEST_CONTAINER_REPO_TAG}" | ||
bash shellspec --jobs 50 | ||
build_and_push: | ||
name: Build and push Docker image | ||
runs-on: ubuntu-latest | ||
if: ${{ github.actor != 'dependabot[bot]' }} | ||
needs: | ||
- shellcheck | ||
- tests | ||
- container_tests | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
|
@@ -116,50 +139,3 @@ jobs: | |
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
provenance: false | ||
- name: Extract tag | ||
run: | | ||
TAGS="${{ steps.meta.outputs.tags }}" | ||
for TAG in ${TAGS}; do | ||
if echo "${TAG}" | grep -q "ghcr.io/${{ github.repository }}-development:dev-"; then | ||
echo "TAG=${TAG}" | ||
echo "${TAG}" > tag.txt | ||
break; | ||
fi | ||
done | ||
- name: Store tag | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: tag | ||
path: tag.txt | ||
|
||
|
||
container_tests: | ||
name: Test container | ||
runs-on: ubuntu-latest | ||
if: ${{ github.actor != 'dependabot[bot]' }} | ||
needs: | ||
- build_and_push | ||
steps: | ||
- name: Set up Docker Buildx | ||
uses: docker/[email protected] | ||
- name: Install shellspec | ||
run: | | ||
mkdir -p ~/shellspec | ||
cd ~/shellspec | ||
git clone https://github.com/shellspec/shellspec.git | ||
ln -s ~/shellspec/shellspec/shellspec /usr/local/bin/shellspec | ||
echo -n "shellspec version: " | ||
shellspec --version | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
- name: Load tag | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: tag | ||
- name: Run tests | ||
run: | | ||
export DOCKERHUB_PASSWORD=${{ secrets.DOCKERHUB_PASSWORD }} | ||
export DOCKERHUB_USERNAME=${{ secrets.DOCKERHUB_USERNAME }} | ||
export GANTRY_TEST_CONTAINER_REPO_TAG=$(cat tag.txt) | ||
echo "GANTRY_TEST_CONTAINER_REPO_TAG=${GANTRY_TEST_CONTAINER_REPO_TAG}" | ||
bash shellspec --jobs 50 |
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 |
---|---|---|
|
@@ -42,8 +42,30 @@ jobs: | |
uses: actions/checkout@v4 | ||
- name: Run tests | ||
run: | | ||
export DOCKERHUB_PASSWORD=${{ secrets.DOCKERHUB_PASSWORD }} | ||
export DOCKERHUB_USERNAME=${{ secrets.DOCKERHUB_USERNAME }} | ||
bash shellspec --jobs 50 | ||
container_tests: | ||
name: Run container tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Docker Buildx | ||
uses: docker/[email protected] | ||
- name: Install shellspec | ||
run: | | ||
mkdir -p ~/shellspec | ||
cd ~/shellspec | ||
git clone https://github.com/shellspec/shellspec.git | ||
ln -s ~/shellspec/shellspec/shellspec /usr/local/bin/shellspec | ||
echo -n "shellspec version: " | ||
shellspec --version | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
- name: Run container tests | ||
run: | | ||
export GANTRY_TEST_CONTAINER=true | ||
export GANTRY_TEST_CONTAINER_REPO_TAG= | ||
echo "GANTRY_TEST_CONTAINER=${GANTRY_TEST_CONTAINER}" | ||
echo "GANTRY_TEST_CONTAINER_REPO_TAG=${GANTRY_TEST_CONTAINER_REPO_TAG}" | ||
bash shellspec --jobs 50 | ||
build_and_push: | ||
|
@@ -52,6 +74,7 @@ jobs: | |
needs: | ||
- shellcheck | ||
- tests | ||
- container_tests | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
|
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
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
Oops, something went wrong.