Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Migrate to GitHub Actions #235

Merged
merged 3 commits into from
Dec 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 0 additions & 90 deletions .circleci/config.yml

This file was deleted.

52 changes: 52 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# yamllint disable-line rule:document-start
name: release

# yamllint disable-line rule:truthy
on:
push:
tags:
- "*.*.*"

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup PHP 8.1
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Build release
run: composer run-script release:build

- uses: actions/upload-artifact@v4
with:
name: gf-sagepay
path: release/*.zip

lint-wp-org:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/download-artifact@v4
with:
name: gf-sagepay
- run: unzip gf-sagepay.zip -d /tmp/plugin-source-code
- run: find /tmp/plugin-source-code -name "*.php" -print0 | xargs -n 1 -0 php -l

publish-to-github-releases:
runs-on: ubuntu-latest
needs: lint-wp-org
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v4
with:
name: gf-sagepay
- name: Create release
run: gh release create "${GITHUB_REF/refs\/tags\//}" gf-sagepay.zip --generate-notes
env:
GH_TOKEN: ${{ github.token }}
41 changes: 41 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# yamllint disable-line rule:document-start
name: test

# yamllint disable-line rule:truthy
on:
push:
branches:
- "*"

jobs:
php:
name: php-${{ matrix.php }}
runs-on: ubuntu-latest
strategy:
matrix:
php: [8.1]
steps:
- uses: actions/checkout@v3

- name: Setup PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> "${GITHUB_OUTPUT}"

- name: Cache dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-${{ matrix.php }}-composer-

- name: Install Composer dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader

- run: composer run-script style:check