Skip to content

Commit

Permalink
Add setup-qemu action (#71)
Browse files Browse the repository at this point in the history
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
  • Loading branch information
crazy-max committed Aug 11, 2020
1 parent 36c90bc commit 64d53ac
Show file tree
Hide file tree
Showing 14 changed files with 5,770 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/setup-qemu-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: setup-qemu-ci

on:
push:
paths:
- .github/workflows/setup-qemu-ci.yml
- setup-qemu/**
pull_request:
paths:
- .github/workflows/setup-qemu-ci.yml
- setup-qemu/**

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
qemu-version:
- latest
- 4.2.0-7
steps:
-
name: Runner info
run: |
sudo apt-get install -y hwinfo
sudo hwinfo --short
sudo mount
-
name: Checkout
uses: actions/checkout@v2.3.1
-
name: Set up QEMU
uses: ./setup-qemu/
with:
qemu-version: ${{ matrix.qemu-version }}
32 changes: 32 additions & 0 deletions .github/workflows/setup-qemu-precheckin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: setup-qemu-precheckin

on:
push:
paths:
- .github/workflows/setup-qemu-precheckin.yml
- setup-qemu/**
pull_request:
paths:
- .github/workflows/setup-qemu-precheckin.yml
- setup-qemu/**

jobs:
pre-checkin:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2.3.1
-
name: Install
run: yarn --cwd ./setup-qemu/ install
-
name: Pre-checkin
run: yarn --cwd ./setup-qemu/ run pre-checkin
-
name: Check for uncommitted changes
run: |
if [[ `git status --porcelain` ]]; then
git status --porcelain
echo "::warning::Found changes. Please run 'yarn --cwd ./setup-qemu/ run pre-checkin' and push"
fi
15 changes: 15 additions & 0 deletions setup-qemu/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# This file is for unifying the coding style for different editors and IDEs.
# More information at http://editorconfig.org

root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
2 changes: 2 additions & 0 deletions setup-qemu/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/dist/** linguist-generated=true
/lib/** linguist-generated=true
95 changes: 95 additions & 0 deletions setup-qemu/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
node_modules
lib

# Jetbrains
/.idea
/*.iml

# Rest of the file pulled from https://github.com/github/gitignore/blob/master/Node.gitignore
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# next.js build output
.next

# nuxt.js build output
.nuxt

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/
11 changes: 11 additions & 0 deletions setup-qemu/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"printWidth": 120,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": true,
"trailingComma": "none",
"bracketSpacing": false,
"arrowParens": "avoid",
"parser": "typescript"
}
51 changes: 51 additions & 0 deletions setup-qemu/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
## About

GitHub Action to install [QEMU static binaries](https://github.com/multiarch/qemu-user-static).

___

* [Usage](#usage)
* [Quick start](#quick-start)
* [Customizing](#customizing)
* [inputs](#inputs)
* [Limitation](#limitation)

## Usage

```yaml
name: ci

on:
pull_request:
branches: master
push:
branches: master
tags:

jobs:
qemu:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Set up QEMU
uses: docker/action/setup-qemu@v2
with:
qemu-version: latest
```
## Customizing
### inputs
Following inputs can be used as `step.with` keys

| Name | Type | Default | Description |
|------------------|---------|-----------|------------------------------------|
| `qemu-version` | String | `latest` | [qemu-user-static](https://github.com/multiarch/qemu-user-static) version (Docker tag). Example: `4.2.0-7` |

## Limitation

This action is only available for Linux [virtual environments](https://help.github.com/en/articles/virtual-environments-for-github-actions#supported-virtual-environments-and-hardware-resources).
17 changes: 17 additions & 0 deletions setup-qemu/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# https://help.github.com/en/articles/metadata-syntax-for-github-actions
name: 'Docker - Setup QEMU'
description: 'GitHub Action to install QEMU static binaries'
author: 'crazy-max'
branding:
color: 'blue'
icon: 'truck'

inputs:
qemu-version:
description: 'QEMU static binaries Docker image version. Example: 4.2.0-7'
default: 'latest'
required: false

runs:
using: 'node12'
main: 'dist/index.js'
Loading

0 comments on commit 64d53ac

Please sign in to comment.