Skip to content

Commit

Permalink
Fix tests workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
D3vil0p3r authored Oct 20, 2024
1 parent 7e7fed1 commit f6f7f45
Showing 1 changed file with 30 additions and 19 deletions.
49 changes: 30 additions & 19 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,44 @@ on:
branches: [ master ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build Package
run: |
CHANGED_FILES=($(git diff --name-only --diff-filter=d $THE_LAST_COMMIT HEAD))
for FILE in $CHANGED_FILES; do
if [[ $(basename $FILE) == "PKGBUILD" ]]; then
docker build -t builder -f travis/Dockerfile $(dirname $FILE)
docker run --rm builder
fi
done
pkgcheck:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
fetch-depth: 0

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pkgcheck-arch --user
pip install pkgcheck-arch
- name: Check Styling
run: |
COMMIT_RANGE=($(git diff --name-only --diff-filter=d $(git log -2 --format=%H | tr '\n' ' ')))
CHANGED_FILES=($(git diff --name-only $COMMIT_RANGE))
for FILE in $CHANGED_FILES; do
CHANGED_FILES=($(git diff --name-only --diff-filter=ACMRT origin/${{ github.event.pull_request.base.ref }}...${{ github.event.pull_request.head.sha }} | tr '\n' ' '))
for FILE in "${CHANGED_FILES[@]}"; do
if [[ $(basename $FILE) == "PKGBUILD" ]]; then
echo "Validating $FILE..."
pkgcheck $FILE
fi
done
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
fetch-depth: 0

- name: Build Package
run: |
CHANGED_FILES=($(git diff --name-only --diff-filter=ACMRT origin/${{ github.event.pull_request.base.ref }}...${{ github.event.pull_request.head.sha }} | tr '\n' ' '))
for FILE in "${CHANGED_FILES[@]}"; do
if [[ $(basename $FILE) == "PKGBUILD" ]]; then
echo "Building $FILE..."
docker build --load -t builder -f travis/Dockerfile $(dirname $FILE)
docker run --rm builder
fi
done

0 comments on commit f6f7f45

Please sign in to comment.