Skip to content

Bump dessant/lock-threads from 3 to 5 #135

Bump dessant/lock-threads from 3 to 5

Bump dessant/lock-threads from 3 to 5 #135

Workflow file for this run

---
name: CI
# yamllint disable-line rule:truthy
on:
push:
pull_request:
types:
- opened
- reopened
- synchronize
workflow_dispatch:
jobs:
information:
name: Gather add-on information
runs-on: ubuntu-latest
outputs:
description: ${{ steps.information.outputs.description }}
environment: ${{ steps.information.outputs.environment }}
name: ${{ steps.information.outputs.name }}
version: ${{ steps.information.outputs.version }}
build_date: ${{ steps.information.outputs.build_date }}
unbound_version: ${{ steps.information.outputs.unbound_version }}
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/[email protected]
- name: ℹ️ Gather version and environment
id: information
shell: bash
# yamllint disable rule:line-length
run: |
sha="${{ github.sha }}"
environment="edge"
version="${sha:0:7}"
if [[ "${{ github.event_name }}" = "release" ]]; then
version="${{ github.event.release.tag_name }}"
version="${version,,}"
version="${version#v}"
environment="stable"
if [[ "${{ github.event.release.prerelease }}" = "true" ]]; then
environment="beta"
fi
fi
unbound_release=$(curl -sH "Accept: application/vnd.github.v3+json" https://api.github.com/repos/NLnetLabs/unbound/tags | jq -r '[.[]|select(.name|startswith("release-"))][0].name')
echo "::set-output name=environment::${environment}"
echo "::set-output name=version::${version}"
echo "::set-output name=unbound_version::${unbound_release:8}"
echo "::set-output name=name::Unbound"
echo "::set-output name=description::Provides unbound in a container"
# yamllint enable rule:line-length
lint-hadolint:
name: Hadolint
needs:
- information
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/[email protected]
- name: 🚀 Run Hadolint
uses: brpaz/[email protected]
with:
dockerfile: "./unbound/Dockerfile"
ignore: "DL3003 DL3007"
lint-json:
name: JSON Lint
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/[email protected]
- name: 🚀 Run JQ
run: |
shopt -s globstar
cat **/*.json | jq '.'
lint-markdown:
name: MarkdownLint
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/[email protected]
- name: 🚀 Run mdl
uses: actionshub/[email protected]
lint-shellcheck:
name: Shellcheck
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/[email protected]
- name: 🚀 Run Shellcheck
uses: ludeeus/[email protected]
env:
SHELLCHECK_OPTS: -s bash
lint-yamllint:
name: YAMLLint
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/[email protected]
- name: 🚀 Run YAMLLint
uses: frenck/[email protected]
lint-prettier:
name: Prettier
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/[email protected]
- name: 🚀 Run Prettier
uses: creyD/[email protected]
with:
prettier_options: --write **/*.{json,js,md,yaml}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build:
name: 👷 Build
needs:
- information
- lint-hadolint
- lint-json
- lint-markdown
- lint-prettier
- lint-shellcheck
- lint-yamllint
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/[email protected]
- name: Install Latest Docker
# yamllint disable rule:line-length
run: |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get install docker-ce
# yamllint enable rule:line-length
- name: 📝 Docker meta
id: meta
uses: docker/metadata-action@v3
with:
# list of Docker images to use as base name for tags
images: |
aperimau/unbound
ghcr.io/aperim/unbound
# generate Docker tags based on the following events/attributes
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=sha
type=edge,enable=true,priority=700,prefix=,suffix=,branch=$repo.default_branch
- name: 🏗 Set up build cache
id: cache
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
# Key is named differently to avoid collision
key: ${{ runner.os }}-multi-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-multi-buildx
- name: 🏗 Set up QEMU
uses: docker/setup-qemu-action@v1
- name: 🏗 Set up Docker Buildx
uses: docker/setup-buildx-action@v1
with:
install: true
- name: 🏗 Login to Docker Container Registry
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: 🏗 Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CI_PAT }}
- name: 🚀 Build
uses: docker/build-push-action@v2
with:
push: true
builder: ${{ steps.buildx.outputs.name }}
context: ./unbound
file: ./unbound/Dockerfile
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-new
# yamllint disable-line rule:line-length
# platforms: linux/amd64,linux/386,linux/arm/v6,linux/arm/v7,linux/arm64/v8
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8
build-args: |
BUILD_DATE=${{ steps.flags.outputs.date }}
BUILD_DESCRIPTION=${{ needs.information.outputs.description }}
BUILD_NAME=${{ needs.information.outputs.name }}
BUILD_REF=${{ github.sha }}
BUILD_REPOSITORY=${{ github.repository }}
BUILD_VERSION=${{ needs.information.outputs.version }}
UNBOUND_VERSION=${{ needs.information.outputs.unbound_version }}
# This ugly bit is necessary, or our cache will grow forever...
# Well until we hit GitHub's limit of 5GB :)
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
- name: 🚚 Swap build cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache