.github/workflows: add build.yaml.

This commit enables CI on GitHub Actions.

Taken from nilium's repository:

e9bf829752/.github/workflows/build.yaml

Plus a few changes:

- only run CI on PRs
- don't run CI on draft PRs or when a PR title or body contains "[ci skip]"
- remove some names
- use more recent void containers
- fix XBPS self update
This commit is contained in:
Érico Rolim 2020-11-02 18:09:05 -03:00 committed by Érico Nogueira Rolim
parent 71a25f3e73
commit d97410a07a
1 changed files with 85 additions and 0 deletions

85
.github/workflows/build.yaml vendored Normal file
View File

@ -0,0 +1,85 @@
name: Check PR
on: pull_request
jobs:
# Lint changed templates.
xlint:
name: Lint templates
runs-on: ubuntu-18.04
env:
PATH: '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
XLINT: '1'
LICENSE_LIST: common/travis/license.lst
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 200
- run: common/travis/fetch_upstream.sh
- run: common/travis/changed_templates.sh
- run: common/travis/fetch-xtools.sh
- run: common/travis/xlint.sh
# Build changed packages.
build:
name: Build packages
runs-on: ubuntu-18.04
if: "!github.event.pull_request.draft && !contains(github.event.pull_request.title, '[ci skip]') && !contains(github.event.pull_request.body, '[ci skip]')"
container:
image: 'voidlinux/masterdir-${{ matrix.config.bootstrap }}:20200607RC01'
env:
PATH: '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
ARCH: '${{ matrix.config.arch }}'
BOOTSTRAP: '${{ matrix.config.bootstrap }}'
HOSTREPO: /hostrepo
strategy:
fail-fast: false
matrix:
config:
- { arch: x86_64, bootstrap: x86_64 }
- { arch: i686, bootstrap: i686 }
- { arch: aarch64, bootstrap: x86_64 }
- { arch: armv7l, bootstrap: x86_64 }
- { arch: x86_64-musl, bootstrap: x86_64-musl }
- { arch: armv6l-musl, bootstrap: x86_64-musl }
- { arch: aarch64-musl, bootstrap: x86_64-musl }
steps:
- name: Prepare container
run: |
# Sync and upgrade once, assume error comes from xbps update
xbps-install -Syu || xbps-install -yu xbps
# Upgrade again (in case there was a xbps update)
xbps-install -yu
# Install git
xbps-install -y git
- uses: actions/checkout@v1
with:
fetch-depth: 200
- name: Create hostrepo
run: ln -s "$(pwd)" /hostrepo
- run: common/travis/set_mirror.sh
- run: common/travis/prepare.sh
- run: common/travis/fetch_upstream.sh
- run: common/travis/changed_templates.sh
- name: Build packages
run: |
(
here="$(pwd)"
cd /
"$here/common/travis/build.sh" "$BOOTSTRAP" "$ARCH"
)
- name: Show files
run: |
(
here="$(pwd)"
cd /
"$here/common/travis/show_files.sh" "$BOOTSTRAP" "$ARCH"
)