refaktorointia
CI Feature / Load example-gitea-env.conf to pipeline env (push) Successful in 18s
unit-tests Link to Bats reports
CI Feature / Bats tests (push) Successful in 1m39s
acc-tests Link to Cucumber reports
CI Feature / Cucumber tests (push) Successful in 1m5s
CI Feature / Report Summary (push) Successful in 4s
CI Feature / Load example-gitea-env.conf to pipeline env (push) Successful in 18s
unit-tests Link to Bats reports
CI Feature / Bats tests (push) Successful in 1m39s
acc-tests Link to Cucumber reports
CI Feature / Cucumber tests (push) Successful in 1m5s
CI Feature / Report Summary (push) Successful in 4s
This commit is contained in:
@@ -1,34 +0,0 @@
|
||||
name: CI Validate
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
env_json:
|
||||
required: true
|
||||
type: string
|
||||
config_path:
|
||||
required: true
|
||||
type: string
|
||||
secrets:
|
||||
GITEA_TOKEN:
|
||||
required: true
|
||||
GIT_PAGES_PUBLISH_TOKEN:
|
||||
required: true
|
||||
|
||||
env:
|
||||
GITEA_API_URL: ${{ fromJson(inputs.env_json).GITEA_API_URL }}
|
||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||
GIT_PAGES_PUBLISH_TOKEN: ${{ secrets.GIT_PAGES_PUBLISH_TOKEN }}
|
||||
CI_CONF_FILE: ${{ inputs.config_path }}
|
||||
|
||||
jobs:
|
||||
validate:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
repository: niko/gitea-ci-library
|
||||
path: .ci
|
||||
|
||||
- name: Validate CI config
|
||||
run: bash .ci/scripts/ci-validate.sh
|
||||
@@ -1,16 +1,26 @@
|
||||
name: Config Provider Library
|
||||
name: Config Provider
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
config_path:
|
||||
required: true
|
||||
type: string
|
||||
secrets:
|
||||
GITEA_TOKEN:
|
||||
required: true
|
||||
GIT_PAGES_PUBLISH_TOKEN:
|
||||
required: true
|
||||
outputs:
|
||||
env_json:
|
||||
value: ${{ jobs.parse-config.outputs.json_data }}
|
||||
config_path:
|
||||
value: ${{ jobs.parse-config.outputs.config_path }}
|
||||
|
||||
env:
|
||||
CI_CONF_FILE: ${{ inputs.config_path }}
|
||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||
GIT_PAGES_PUBLISH_TOKEN: ${{ secrets.GIT_PAGES_PUBLISH_TOKEN }}
|
||||
|
||||
jobs:
|
||||
parse-config:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -19,6 +29,13 @@ jobs:
|
||||
config_path: ${{ steps.set-path.outputs.CONFIG_PATH }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
repository: niko/gitea-ci-library
|
||||
path: .ci
|
||||
|
||||
- name: Validate CI config
|
||||
run: bash .ci/scripts/ci-validate.sh
|
||||
|
||||
- id: convert
|
||||
run: |
|
||||
|
||||
@@ -38,11 +38,6 @@ jobs:
|
||||
repository: niko/gitea-ci-library
|
||||
path: .ci
|
||||
|
||||
- name: Set Gitea status to PENDING
|
||||
run: |
|
||||
echo "===== gitea-ci-library - Docker Build & Push | begin ====="
|
||||
bash .ci/scripts/report-status.sh pending "Building and pushing Docker image..." ci-docker-build-push
|
||||
|
||||
- name: Build and push container
|
||||
env:
|
||||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME || github.actor }}
|
||||
|
||||
@@ -30,9 +30,6 @@ jobs:
|
||||
repository: niko/gitea-ci-library
|
||||
path: .ci
|
||||
|
||||
- name: Pending
|
||||
run: bash .ci/scripts/report-status.sh pending "Running Bats tests..." ci-bats
|
||||
|
||||
- name: Run bats tests
|
||||
id: bats-tests
|
||||
shell: bash
|
||||
@@ -61,7 +58,7 @@ jobs:
|
||||
if: always()
|
||||
run: |
|
||||
if [ "${BATS_EXIT}" = "0" ]; then
|
||||
bash .ci/scripts/report-status.sh success "Bats tests OK" ci-bats bats
|
||||
bash .ci/scripts/report-status.sh success "Link to Bats reports" unit-tests bats
|
||||
else
|
||||
bash .ci/scripts/report-status.sh failure "Bats tests FAILED" ci-bats bats
|
||||
bash .ci/scripts/report-status.sh failure "Link to Bats reports" unit-tests bats
|
||||
fi
|
||||
|
||||
@@ -32,9 +32,6 @@ jobs:
|
||||
repository: niko/gitea-ci-library
|
||||
path: .ci
|
||||
|
||||
- name: Pending
|
||||
run: bash .ci/scripts/report-status.sh pending "Running Cucumber tests..." ci-cucumber
|
||||
|
||||
- name: Run cucumber tests
|
||||
id: cucumber-tests
|
||||
shell: bash
|
||||
@@ -60,14 +57,14 @@ jobs:
|
||||
run: |
|
||||
if [ "${CUCUMBER_EXIT}" = "0" ]; then
|
||||
if [ -f "reports/${GITHUB_SHA:0:8}/cucumber/index.html" ]; then
|
||||
bash .ci/scripts/report-status.sh success "Cucumber tests OK" ci-cucumber cucumber
|
||||
bash .ci/scripts/report-status.sh success "Link to Cucumber reports" acc-tests cucumber
|
||||
else
|
||||
bash .ci/scripts/report-status.sh success "Cucumber tests OK" ci-cucumber
|
||||
bash .ci/scripts/report-status.sh success "Link to Cucumber reports" acc-tests
|
||||
fi
|
||||
else
|
||||
if [ -f "reports/${GITHUB_SHA:0:8}/cucumber/index.html" ]; then
|
||||
bash .ci/scripts/report-status.sh failure "Cucumber tests FAILED" ci-cucumber cucumber
|
||||
bash .ci/scripts/report-status.sh failure "Link to Cucumber reports" acc-tests cucumber
|
||||
else
|
||||
bash .ci/scripts/report-status.sh failure "Cucumber tests FAILED" ci-cucumber
|
||||
bash .ci/scripts/report-status.sh failure "Link to Cucumber reports" acc-tests
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -8,18 +8,10 @@ on:
|
||||
jobs:
|
||||
load-config:
|
||||
name: Load example-gitea-env.conf to pipeline env
|
||||
uses: niko/gitea-ci-library/.gitea/workflows/config-provider.yml@main
|
||||
with:
|
||||
config_path: .gitea/workflows/example-gitea-env.conf
|
||||
|
||||
validate:
|
||||
name: Validate CI config
|
||||
needs: [load-config]
|
||||
uses: niko/gitea-ci-library/.gitea/workflows/ci-validate.yml@feature/docker-kuntoon
|
||||
uses: niko/gitea-ci-library/.gitea/workflows/config-provider.yml@feature/docker-kuntoon
|
||||
secrets: inherit
|
||||
with:
|
||||
env_json: ${{ needs.load-config.outputs.env_json }}
|
||||
config_path: ${{ needs.load-config.outputs.config_path }}
|
||||
config_path: .gitea/workflows/example-gitea-env.conf
|
||||
|
||||
bats:
|
||||
name: Bats tests
|
||||
|
||||
@@ -8,7 +8,8 @@ on:
|
||||
jobs:
|
||||
load-config:
|
||||
name: Load example-gitea-env.conf to pipeline env
|
||||
uses: niko/gitea-ci-library/.gitea/workflows/config-provider.yml@main
|
||||
uses: niko/gitea-ci-library/.gitea/workflows/config-provider.yml@feature/docker-kuntoon
|
||||
secrets: inherit
|
||||
with:
|
||||
config_path: .gitea/workflows/example-gitea-env.conf
|
||||
|
||||
@@ -20,16 +21,6 @@ jobs:
|
||||
with:
|
||||
env_json: ${{ needs.load-config.outputs.env_json }}
|
||||
|
||||
validate:
|
||||
name: Validate CI config
|
||||
needs: [load-config, check-version]
|
||||
if: needs.check-version.outputs.artifact_exists != 'true'
|
||||
uses: niko/gitea-ci-library/.gitea/workflows/ci-validate.yml@feature/docker-kuntoon
|
||||
secrets: inherit
|
||||
with:
|
||||
env_json: ${{ needs.load-config.outputs.env_json }}
|
||||
config_path: ${{ needs.load-config.outputs.config_path }}
|
||||
|
||||
bats:
|
||||
name: Bats tests
|
||||
needs: [load-config, check-version]
|
||||
|
||||
Reference in New Issue
Block a user