赞
踩
name:GreetEveryone
# This workflow is triggered on pushes to the repository.
on: [push]
jobs:
your_job_id:
# Job name is Greeting
name: Greeting
# This job runs on Linux
runs-on: ubuntu-latest
steps:
# This step uses GitHub's hello-world-javascript-action: https://github.com/actions/hello-world-javascript-action
- name: Hello world
uses: actions/hello-world-javascript-action@v1
with:
who-to-greet: 'Mona the Octocat'
id: hello
# This step prints an output (time) from the previous step's action.
- name: Echo the greeting's time
run: echo 'The time was ${{ steps.hello.outputs.time }}.
name: <workflow name>
on: <events that trigger workflows>
jobs:
<job_id>:
name: <job_name>
runs-on: <runner>
steps:
- name: <step_name>
uses: <action>
with:
<parameter_name>: <parameter_value>
id: <step_id>
- name: <step_name>
run: <commands>
actions/checkout@25a956c # 指向一个 commit
actions/checkout@v1 # 指向一个标签
actions/checkout@main # 指向一个分支
lukka/run-vcpkg@v6
lukka/run-cmake@v3
name: GitHub Actions Demo
on: push
on: [push, pull_request]
jobs:
my_first_job:
name: My first job
my_second_job:
name: My second job
on:
push:
branches:
- master
jobs:
job1:
job2:
needs: job1
job3:
needs: [job1, job2]
ubuntu-latest,ubuntu-18.04或ubuntu-16.04
windows-latest,windows-2019或windows-2016
macOS-latest或macOS-10.14
runs-on: ubuntu-18.04
jobs.<job_id>.steps.name:步骤名称
jobs.<job_id>.steps.run:该步骤运行的命令或者 action
jobs.<job_id>.steps.env:该步骤所需的环境变量
# 1
name: build
# 2
on: [push, pull_request]
# 3
jobs:
run-test:
# 4
runs-on: macOS-latest
# 5
strategy:
matrix:
destination: [
'macOS',
'iOS Simulator,name=iPhone 8',
'tvOS Simulator,name=Apple TV',
'watchOS Simulator,name=Apple Watch Series 5 - 40mm'
]
swift-version: [5.0]
# 6
steps:
# 7
- uses: actions/checkout@v1
- uses: actions/cache@v1 # 8
id: bundler-cache # 9
with: # 10
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
# 11
- name: Bundle setup
run: bundle config path vendor/bundle
- name: Bundle install
if: steps.bundler-cache.outputs.cache-hit != 'true' # 12
run: bundle install --jobs 4 --retry 3
- name: Run tests
env: # 13
DESTINATION: platform=${{ matrix.destination }}
SWIFT_VERSION: ${{ matrix.swift-version }}
run: bundle exec fastlane test_ci # 14
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。