Patch release 0.9.3 #59
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (c) 2022 Robert Bosch GmbH and its subsidiaries. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); you may not | |
# use this file except in compliance with the License. You may obtain a copy of | |
# the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | |
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | |
# License for the specific language governing permissions and limitations under | |
# the License. | |
name: test, lint & deploy | |
on: | |
push: | |
pull_request: | |
# Set workflow_dispatch to enable triggering the workflow in the web UI. | |
workflow_dispatch: | |
defaults: | |
run: | |
shell: bash | |
concurrency: | |
group: ${{ github.workflow }}:${{ github.head_ref || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build-deploy: | |
timeout-minutes: 45 | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Install system dependencies | |
env: | |
DEBIAN_FRONTEND: noninteractive | |
run: | | |
sudo apt-get update -qq | |
sudo apt-get install -qqy --no-install-recommends \ | |
build-essential ca-certificates coreutils curl gcc git jq \ | |
kcov make parallel shellcheck | |
- name: Install bats | |
run: | | |
git clone https://github.com/bats-core/bats-core.git | |
sudo ./bats-core/install.sh /usr/local | |
rm -rf bats-core | |
- name: Disable git config safety checks for this repository | |
run: | | |
git config --global --add safe.directory "$(pwd)" | |
- name: Install shfmt | |
env: | |
VERSION: 3.7.0 | |
SHA256: 0264c424278b18e22453fe523ec01a19805ce3b8ebf18eaf3aadc1edc23f42e3 | |
URL: https://github.com/mvdan/sh/releases/download | |
run: | | |
curl -o shfmt --location \ | |
"${URL}/v${VERSION}/shfmt_v${VERSION}_linux_amd64" | |
echo "${SHA256} shfmt" | sha256sum -c | |
chmod +x shfmt | |
sudo mv shfmt /usr/local/bin/shfmt | |
- name: Install NVM | |
run: | | |
curl -sSfL -o install_nvm.sh "${BASE_URL}/${NVM_VERSION}/install.sh" | |
echo "${NVMINSTALL_SHA256} install_nvm.sh" | sha256sum --check | |
bash install_nvm.sh | |
env: | |
NVM_VERSION: v0.39.5 | |
NVMINSTALL_SHA256: 69da4f89f430cd5d6e591c2ccfa2e9e3ad55564ba60f651f00da85e04010c640 | |
BASE_URL: "https://raw.githubusercontent.com/nvm-sh/nvm" | |
- name: Install prettier | |
run: | | |
source "${HOME}/.nvm/nvm.sh" | |
nvm install "${NODE_VERSION}" | |
npm install -g prettier | |
dirname "$(which prettier)" >> "${GITHUB_PATH}" | |
env: | |
NODE_VERSION: "20" | |
- name: Install mdslw | |
run: | | |
curl -sSfL -o mdslw "${BASE_URL}/${MDSLW_VERSION}/mdslw_x86_64-unknown-linux-musl" | |
echo "${MDSLW_SHA256} mdslw" | sha256sum --check | |
chmod +x mdslw | |
sudo mv mdslw /usr/local/bin | |
env: | |
MDSLW_VERSION: 0.12.4 | |
MDSLW_SHA256: 2899399d14c230f3bc3e4d8b275a1e7a61f061e65fc58e79a0ef1802c1c534bf | |
BASE_URL: "https://github.com/razziel89/mdslw/releases/download" | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version-file: "go/go.mod" | |
cache: true | |
- name: Build Package | |
run: make build | |
- name: Test Package | |
run: make test | |
- name: Lint Package | |
run: make lint | |
- name: Test Supported Bash Versions | |
if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') }} | |
run: make test-bash-versions | |
- name: Publish package on GH (only tags) | |
if: ${{ startsWith(github.ref, 'refs/tags/') }} | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: shellmock.bash | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |