on.. ](/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#onpushpull_requestbranchestags) on..paths ](/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#onpushpull_requestpaths) |
| [`triggers { upstreamprojects() }`](https://jenkins.io/doc/book/pipeline/syntax/#triggers) | [`jobs.| Jenkins Pipeline | {% data variables.product.prodname_actions %} Workflow |
|---|---|
| ```yaml pipeline { agent any triggers { cron('H/15 * * * 1-5') } } ``` | ```yaml on: schedule: - cron: '*/15 * * * 1-5' ``` |
| Jenkins Pipeline | {% data variables.product.prodname_actions %} Workflow |
|---|---|
| ```yaml pipeline { agent any environment { MAVEN_PATH = '/usr/local/maven' } } ``` | ```yaml jobs: maven-build: env: MAVEN_PATH: '/usr/local/maven' ``` |
| Jenkins Pipeline | {% data variables.product.prodname_actions %} Workflow |
|---|---|
| ```yaml pipeline { triggers { upstream( upstreamProjects: 'job1,job2', threshold: hudson.model.Result.SUCCESS ) } } ``` | ```yaml jobs: job1: job2: needs: job1 job3: needs: [job1, job2] ``` |
| Jenkins Pipeline | {% data variables.product.prodname_actions %} Workflow |
|---|---|
| ```yaml pipeline { agent none stages { stage('Run Tests') { matrix { axes { axis { name: 'PLATFORM' values: 'macos', 'linux' } } agent { label "${PLATFORM}" } stages { stage('test') { tools { nodejs "node-12" } steps { dir("scripts/myapp") { sh(script: "npm install -g bats") sh(script: "bats tests") } } } } } } } } ``` | {% raw %} ```yaml name: demo-workflow on: push: jobs: test: runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: os: [macos-latest, ubuntu-latest] steps: - uses: actions/checkout@v1 - uses: actions/setup-node@v1 with: node-version: 12 - run: npm install -g bats - run: bats tests working-directory: scripts/myapp ``` {% endraw %} |