github action

发布时间 2023-08-15 19:05:37作者: fndefbwefsowpvqfx

In your repository, create the .github/workflows/ directory to store your workflow files.

In the .github/workflows/ directory, create a new file called learn-github-actions.yml and add the following code.

name: learn-github-actions
run-name: ${{ github.actor }} is learning GitHub Actions
on: [push]
jobs:
  check-bats-version:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-node@v3
        with:
          node-version: '14'
      - run: npm install -g bats
      - run: bats -v

Runner

https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#choosing-github-hosted-runners

https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners

Choosing GitHub-hosted runners

If you use a GitHub-hosted runner, each job runs in a fresh instance of a runner image specified by runs-on.

Available GitHub-hosted runner types are:

Runner image 	          YAML workflow label 	            Notes
Windows Server 2022 	  windows-latest or windows-2022 	The windows-latest label currently uses the Windows Server 2022 runner image.
Windows Server 2019 	  windows-2019 	                    None
Ubuntu 22.04 	          ubuntu-latest or ubuntu-22.04 	The ubuntu-latest label currently uses the Ubuntu 22.04 runner image.
Ubuntu 20.04 	          ubuntu-20.04 	                    None
macOS 13 Ventura [Beta]   macos-13 or macos-13-xl 	        None
macOS 12 Monterey 	      macos-latest, macos-12,
                          macos-latest-xl or macos-12-xl 	The macos-latest and macos-latest-xl workflow labels currently uses the macOS 12 runner image.
macOS 11 Big Sur 	      macos-11 	None

Preinstalled-software

https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#preinstalled-software

https://github.com/actions/runner-images/blob/main/images/win/Windows2022-Readme.md

https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2004-Readme.md

https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md

Hardware

Hardware specification for Windows and Linux virtual machines:

    2-core CPU (x86_64)
    7 GB of RAM
    14 GB of SSD space

Hardware specification for macOS virtual machines:

    3-core CPU (x86_64)
    14 GB of RAM
    14 GB of SSD space