siivous: env block + validate job + siistit kutsut
This commit is contained in:
@@ -2,6 +2,9 @@ name: Build Feature
|
|||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
inputs:
|
inputs:
|
||||||
|
env_json:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
bats-image:
|
bats-image:
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
@@ -15,6 +18,9 @@ on:
|
|||||||
required: true
|
required: true
|
||||||
|
|
||||||
env:
|
env:
|
||||||
|
GITEA_API_URL: ${{ fromJson(inputs.env_json).GITEA_API_URL }}
|
||||||
|
PAGES_HOST: ${{ fromJson(inputs.env_json).PAGES_HOST }}
|
||||||
|
GIT_PAGES_PUBLISH_URL: ${{ fromJson(inputs.env_json).GIT_PAGES_PUBLISH_URL }}
|
||||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||||
GIT_PAGES_PUBLISH_TOKEN: ${{ secrets.GIT_PAGES_PUBLISH_TOKEN }}
|
GIT_PAGES_PUBLISH_TOKEN: ${{ secrets.GIT_PAGES_PUBLISH_TOKEN }}
|
||||||
|
|
||||||
@@ -33,7 +39,6 @@ jobs:
|
|||||||
|
|
||||||
bats:
|
bats:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: validate
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@@ -41,9 +46,6 @@ jobs:
|
|||||||
repository: niko/gitea-ci-library
|
repository: niko/gitea-ci-library
|
||||||
path: .ci
|
path: .ci
|
||||||
|
|
||||||
- name: Load env
|
|
||||||
run: grep -v '^#' .gitea/workflows/feature-env.conf >> "$GITHUB_ENV"
|
|
||||||
|
|
||||||
- name: Run bats tests
|
- name: Run bats tests
|
||||||
id: bats-tests
|
id: bats-tests
|
||||||
shell: bash
|
shell: bash
|
||||||
@@ -78,7 +80,6 @@ jobs:
|
|||||||
|
|
||||||
cucumber:
|
cucumber:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: validate
|
|
||||||
container:
|
container:
|
||||||
image: ${{ inputs.cucumber-node-image }}
|
image: ${{ inputs.cucumber-node-image }}
|
||||||
steps:
|
steps:
|
||||||
@@ -88,9 +89,6 @@ jobs:
|
|||||||
repository: niko/gitea-ci-library
|
repository: niko/gitea-ci-library
|
||||||
path: .ci
|
path: .ci
|
||||||
|
|
||||||
- name: Load env
|
|
||||||
run: grep -v '^#' .gitea/workflows/feature-env.conf >> "$GITHUB_ENV"
|
|
||||||
|
|
||||||
- name: Prepare cucumber
|
- name: Prepare cucumber
|
||||||
id: prepare-cucumber
|
id: prepare-cucumber
|
||||||
shell: bash
|
shell: bash
|
||||||
@@ -149,9 +147,6 @@ jobs:
|
|||||||
repository: niko/gitea-ci-library
|
repository: niko/gitea-ci-library
|
||||||
path: .ci
|
path: .ci
|
||||||
|
|
||||||
- name: Load env
|
|
||||||
run: grep -v '^#' .gitea/workflows/feature-env.conf >> "$GITHUB_ENV"
|
|
||||||
|
|
||||||
- name: Generate report index
|
- name: Generate report index
|
||||||
run: bash .ci/.gitea/scripts/generate-report-index.sh
|
run: bash .ci/.gitea/scripts/generate-report-index.sh
|
||||||
|
|
||||||
|
|||||||
@@ -5,18 +5,27 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
load-config:
|
||||||
|
uses: niko/gitea-ci-library/.gitea/workflows/config-provider.yml@feature/pipeline-cleanup
|
||||||
|
with:
|
||||||
|
config_path: .gitea/workflows/feature-env.conf
|
||||||
|
|
||||||
feature:
|
feature:
|
||||||
if: github.ref != 'refs/heads/main'
|
if: github.ref != 'refs/heads/main'
|
||||||
|
needs: [load-config]
|
||||||
uses: niko/gitea-ci-library/.gitea/workflows/build-feature.yml@feature/pipeline-cleanup
|
uses: niko/gitea-ci-library/.gitea/workflows/build-feature.yml@feature/pipeline-cleanup
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
with:
|
with:
|
||||||
|
env_json: ${{ needs.load-config.outputs.env_json }}
|
||||||
bats-image: bats/bats:latest
|
bats-image: bats/bats:latest
|
||||||
cucumber-node-image: node:22
|
cucumber-node-image: node:22
|
||||||
|
|
||||||
main:
|
main:
|
||||||
if: github.ref == 'refs/heads/main'
|
if: github.ref == 'refs/heads/main'
|
||||||
|
needs: [load-config]
|
||||||
uses: niko/gitea-ci-library/.gitea/workflows/build-feature.yml@feature/pipeline-cleanup
|
uses: niko/gitea-ci-library/.gitea/workflows/build-feature.yml@feature/pipeline-cleanup
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
with:
|
with:
|
||||||
|
env_json: ${{ needs.load-config.outputs.env_json }}
|
||||||
bats-image: bats/bats:latest
|
bats-image: bats/bats:latest
|
||||||
cucumber-node-image: node:22
|
cucumber-node-image: node:22
|
||||||
|
|||||||
Reference in New Issue
Block a user