Skip to content

Add asdf

Add asdf #66

name: Checks
on: [ pull_request, workflow_dispatch ]
jobs:
changed-files:
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
ubuntu-files: ${{ steps.changes.outputs.ubuntu-files}}
debian-files: ${{ steps.changes.outputs.debian-files}}
centos-files: ${{ steps.changes.outputs.centos-files}}
steps:
# Make sure we have some code to diff.
- name: Checkout repository
uses: actions/checkout@v2
- name: Get changed files
id: changes
# Set outputs using the command.
run: |
git fetch origin "+refs/heads/${{github.base_ref}}:refs/remote/origin/${{github.head_ref}}"
export UBUNTU_FILES="$(git diff --diff-filter=d --name-only origin/"${{github.base_ref}}" -- | grep ubuntu | base64 -w 0)"
export DEBIAN_FILES="$(git diff --diff-filter=d --name-only origin/"${{github.base_ref}}" -- | grep debian | base64 -w 0)"
export CENTOS_FILES="$(git diff --diff-filter=d --name-only origin/"${{github.base_ref}}" -- | grep centos | base64 -w 0)"
echo "::set-output name=ubuntu-files::$(echo "$UBUNTU_FILES")"
echo "::set-output name=debian-files::$(echo "$DEBIAN_FILES")"
echo "::set-output name=centos-files::$(echo "$CENTOS_FILES")"
ubuntu-checks:
name: Run modified scripts to test for errors on Ubuntu
runs-on: ubuntu-latest
container: 'ubuntu:latest'
needs: changed-files
if: ${{needs.changed-files.outputs.ubuntu-files}}
steps:
- uses: actions/checkout@v2
- name: Execute changed files
run: |
apt update && apt install curl -y
FILES=$(echo ${{needs.changed-files.outputs.ubuntu-files}} | base64 -d)
for file in $FILES
do
echo "::debug::Running the ${file}"
bash "$file"
echo "::debug::Finished the ${file}"
done
centos-checks:
name: Run modified scripts to test for errors on CentOS
runs-on: ubuntu-latest
container: 'centos:latest'
needs: changed-files
if: ${{needs.changed-files.outputs.centos-files}}
steps:
- uses: actions/checkout@v2
- name: Execute changed files
run: |
yum update -q -y && yum install curl -q -y
FILES=$(echo ${{needs.changed-files.outputs.centos-files}} | base64 -d)
for file in $FILES
do
echo "::debug::Running the ${file}"
bash "$file"
echo "::debug::Finished the ${file}"
done
debian-checks:
name: Run modified scripts to test for errors on Debian
runs-on: ubuntu-latest
container: 'debian:latest'
needs: changed-files
if: ${{needs.changed-files.outputs.debian-files}}
steps:
- uses: actions/checkout@v2
- name: Execute changed files
run: |
apt update && apt install curl -y
FILES=$(echo ${{needs.changed-files.outputs.debian-files}} | base64 -d)
for file in $FILES
do
echo "::debug::Running the ${file}"
bash "$file"
echo "::debug::Finished the ${file}"
done