1. Cross-platform CI/CD syntax
Encyclopedia home · Workflow syntax
Use a shared repository script, ci/verify.sh, in each implementation. Give it one clear exit-code contract. For a minimal fixture, it can contain set -eu followed by test -s README.md. Treat event security, platform credentials and workflow scheduling as provider-specific configuration.
| Concept | GitHub Actions and Gitea Actions | GitLab CI | Jenkins Declarative |
|---|---|---|---|
| Entry file | .github/workflows/*.yml or .gitea/workflows/*.yml | .gitlab-ci.yml | Jenkinsfile as configured by job |
| Execution unit | jobs.<id> with steps | Top-level job with script | Stage and steps |
| Shell commands | run | script | sh on Unix and bat on Windows |
| Dependencies | needs | needs DAG and optional artifact transfer | Stage order, parallel blocks or explicit orchestration |
| Parallel work | Independent jobs or matrix | Eligible jobs in the same stage and parallel | parallel stages or matrix |
| Runner selection | runs-on, labels and compatible executors | tags plus runner settings | agent with label |
| Variables | env, inputs, vars | variables | environment |
| Conditions | if | rules and workflow rules | when |
| Artifacts | Compatible upload/download actions | artifacts, needs.artifacts | archiveArtifacts or in-pipeline stash |
| Credentials | secrets and scoped job token | Protected/masked/file variables and job token | withCredentials or credentials binding |
| Matrix | strategy.matrix | parallel.matrix | matrix.axes |
1.1 GitHub and Gitea
Save the following in the respective workflow directory. Confirm that the chosen Gitea label is registered and that the runner resolves the checkout action. A deployment job requiring environment reviewers, OIDC, or packages write needs a platform-specific design. Gitea currently ignores the job environment key and uses different job-token permission scopes and registry credentials.
name: Common verification
on: [push, pull_request]
jobs:
verify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- run: bash ci/verify.sh1.2 GitLab
Save as .gitlab-ci.yml. Choose a runner that supports the Docker image and job runtime. This rule set starts MR pipelines for active PRs and default-branch pipelines after merging.
workflow:
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
verify:
image: bash:5.2
script:
- bash ci/verify.sh1.3 Jenkins
Save as Jenkinsfile in a multibranch job with trusted agent selection and already configured SCM discovery. The exit status of sh marks the stage.
pipeline {
agent { label 'linux' }
options { timeout(time: 10, unit: 'MINUTES') }
stages {
stage('Verify') {
steps { sh 'bash ci/verify.sh' }
}
}
}1.4 Additional platform mappings
| Platform | Entry and execution | Dependency and artifact concepts |
|---|---|---|
| Azure Pipelines | azure-pipelines.yml, stages/jobs/steps, pool | dependsOn, publish/download pipeline artifacts |
| CircleCI | .circleci/config.yml, jobs and an executor | workflow requires, workspaces and stored artifacts |
| Tekton | Task, Pipeline, and PipelineRun resources | runAfter, task results, workspaces and explicit artifact storage |
| Buildkite | Often .buildkite/pipeline.yml, command steps and agent queues | depends_on, build artifacts and block steps |
| AWS CodeBuild | buildspec.yml, build phases and configured compute | Stage ordering within a build, artifact export, multi-stage delivery via CodePipeline |
| Dagger | A project/module plus dagger call functions | Typed function outputs and content-addressed execution, with triggers supplied by the caller |
Check GitHub, Gitea, GitLab, Jenkins, Azure, CircleCI, Tekton, Buildkite, CodeBuild, and Dagger for platform-specific schema and version support.