Skip to content

Merge pull request #1462 from yedayak/shfmt-fix #3380

Merge pull request #1462 from yedayak/shfmt-fix

Merge pull request #1462 from yedayak/shfmt-fix #3380

Workflow file for this run

name: ci
on:
pull_request:
push:
branches:
- main
permissions: {}
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with: # for gitlint
persist-credentials: false
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
with:
python-version: ">=3.7"
cache: pip
cache-dependency-path: |
.github/requirements.txt
test/requirements*.txt
- uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: ~/.cache/pre-commit
key: pre-commit-${{hashFiles('.pre-commit-config.yaml')}}
- name: Install dependencies
run: |
python3 -m venv venv # for venv-run
source venv/bin/activate
python3 -m pip install -Ur .github/requirements.txt
- run: venv/bin/gitlint --commits "origin/$GITHUB_BASE_REF..HEAD"
if: github.event_name == 'pull_request'
- name: Run pre-commit checks
run: |
source venv/bin/activate
pre-commit run --color=always --all-files --show-diff-on-failure
distcheck:
runs-on: ubuntu-latest
permissions:
# Permissions from https://github.com/googleapis/release-please-action?tab=readme-ov-file#basic-configuration
# TODO: This is only needed for release, maybe split the release steps to a different job?
contents: write
pull-requests: write
# Needed for adding labels for PRs, we shouldn't actually need this, see https://github.com/orgs/community/discussions/156181
issues: write
strategy:
matrix:
include:
- dist: alpine
- dist: centos7
- dist: debian10
- dist: debian10
bsd: true
network: none
- dist: fedoradev
- dist: ubuntu14
fail-fast: false
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
- uses: googleapis/release-please-action@c2a5a2bd6a758a0937f1ddb1e8950609867ed15c # v4.3.0
with:
config-file: .github/release-please-config.json
manifest-file: .github/release-please-manifest.json
id: release
if: github.event_name == 'push' && matrix.dist == 'alpine'
# A "container" workflow config would be cleaner here, but comes with
# some restrictions/oddities: changes root's $HOME to /github/home
# without changing the actual home dir that can cause some problems,
# and does not provide a way to run with --network none.
- name: Run main build
run: >-
docker run
--rm
--tty
--env CI=true
--env BSD=${{matrix.bsd}}
--env PYTESTFLAGS="--verbose -p no:cacheprovider"
--env NETWORK=$NETWORK
--env BASH_COMPLETION_TEST_LIVE_SSH_HOST=localhost
${NETWORK:+--network $NETWORK}
--volume $PWD:/usr/src/bash-completion
--workdir /usr/src/bash-completion
ghcr.io/scop/bash-completion/test:${{matrix.dist}}
test/docker/entrypoint.sh
env:
NETWORK: ${{matrix.network}}
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
path: |
bash-completion-*.tar.xz
sha256sums.txt
if: matrix.dist == 'alpine'
- name: Upload release assets
run: |
set -x
gh release upload ${RELEASE_PLEASE_TAG_NAME} \
bash-completion-$(cat version.txt).tar.xz sha256sums.txt
env:
GH_TOKEN: ${{github.token}}
RELEASE_PLEASE_TAG_NAME: ${{steps.release.outputs.tag_name}}
if: steps.release.outputs.release_created