Skip to content

Commit

Permalink
Merge pull request #74 from shizunge/readme
Browse files Browse the repository at this point in the history
Readme
  • Loading branch information
shizunge authored Dec 5, 2024
2 parents 5a7b04b + d1a0d1f commit cc6551a
Show file tree
Hide file tree
Showing 32 changed files with 2,946 additions and 1,542 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ jobs:
uses: actions/checkout@v4
- name: Generate tests coverage reports
run: |
export DOCKERHUB_PASSWORD=${{ secrets.DOCKERHUB_PASSWORD }}
export DOCKERHUB_USERNAME=${{ secrets.DOCKERHUB_USERNAME }}
bash shellspec --kcov
bash shellspec --kcov --jobs 50
- name: Upload reports
uses: actions/upload-artifact@v4
with:
Expand Down
29 changes: 27 additions & 2 deletions .github/workflows/on-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ jobs:
shellcheck src/*.sh tests/*.sh
set +e
tests:
name: Run tests
test_scripts:
name: Test scripts
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -37,6 +37,8 @@ jobs:
- gantry_cleanup_images_spec.sh
- gantry_common_options_spec.sh
- gantry_filters_spec.sh
- gantry_jobs_spec.sh
- gantry_login_docker_config_spec.sh
- gantry_login_negative_spec.sh
- gantry_login_spec.sh
- gantry_manifest_spec.sh
Expand Down Expand Up @@ -64,3 +66,26 @@ jobs:
run: |
bash shellspec --pattern tests/${{ matrix.test_suit }}
test_container:
name: Test container
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
82 changes: 30 additions & 52 deletions .github/workflows/on-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ jobs:
shellcheck src/*.sh tests/*.sh
set +e
tests:
name: Test script
test_scripts:
name: Test scripts
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -40,6 +40,8 @@ jobs:
- gantry_cleanup_images_spec.sh
- gantry_common_options_spec.sh
- gantry_filters_spec.sh
- gantry_jobs_spec.sh
- gantry_login_docker_config_spec.sh
- gantry_login_negative_spec.sh
- gantry_login_spec.sh
- gantry_manifest_spec.sh
Expand All @@ -65,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 }}
test_container:
name: Test container
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
- test_scripts
- test_container
steps:
- name: Checkout Code
uses: actions/checkout@v4
Expand Down Expand Up @@ -114,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 --tag "container_test:true"
33 changes: 28 additions & 5 deletions .github/workflows/on-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ jobs:
shellcheck src/*.sh tests/*.sh
set +e
tests:
name: Run tests
test_scripts:
name: Test scripts
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
Expand All @@ -42,16 +42,39 @@ 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
test_container:
name: Test container
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
needs:
- shellcheck
- tests
- test_scripts
- test_container
steps:
- name: Checkout Code
uses: actions/checkout@v4
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.shellspec-quick.log
coverage
gantry-test-tmp
Loading

0 comments on commit cc6551a

Please sign in to comment.