From 76260dd71dfb1baf538b60db7b4e2e238d3b6f53 Mon Sep 17 00:00:00 2001 From: Chris McKnight Date: Fri, 7 Feb 2025 16:08:55 -0600 Subject: [PATCH 1/4] ci(actions): Convert Travis CI to GH Actions --- .github/workflows/ci.yml | 58 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..e1b5a84 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,58 @@ +name: Continuous Integration + +on: + push: + pull_request: + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: + - ubuntu-latest + - ubuntu-20.04 + php-version: + - 7.1 + - 7.2 + - 7.3 + - 8.0 + - 8.1 + - 8.2 + - 8.3 + - 8.4 + steps: + - name: Install dependencies (Ubuntu) + if: runner.os == 'Linux' + run: |- + sudo apt-get update + sudo apt-get install -y curl openssl + + - uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + + - name: Cache multiple paths + uses: actions/cache@v4 + with: + path: |- + $HOME/libsodium + vendor + key: ${{ runner.os }}-php-${{ hashFiles('composer.json') }} + restore-keys: | + ${{ runner.os }}-php- + + - uses: actions/checkout@v4 + - name: Install PHP dependencies + run: |- + composer selfupdate + sed -i s#\>=5.4.0#\>=5.3.0#g composer.json + ./bin/install-dependencies.sh + composer install --prefer-source --no-ansi --no-interaction + + - name: Run tests + run: |- + phpunit + php vendor/bin/coveralls -v + From b523a4b44df1364ead655b58002b884e226c52af Mon Sep 17 00:00:00 2001 From: Chris McKnight Date: Fri, 7 Feb 2025 16:26:30 -0600 Subject: [PATCH 2/4] ci(actions): Update pecl directory --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e1b5a84..7eedb7d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,7 +27,7 @@ jobs: if: runner.os == 'Linux' run: |- sudo apt-get update - sudo apt-get install -y curl openssl + sudo apt-get install -y build-essential curl openssl - uses: shivammathur/setup-php@v2 with: @@ -48,6 +48,7 @@ jobs: run: |- composer selfupdate sed -i s#\>=5.4.0#\>=5.3.0#g composer.json + pecl config-set php_dir ${{ runner.temp }} ./bin/install-dependencies.sh composer install --prefer-source --no-ansi --no-interaction From 2ce0dd14c02d3d99a5be01e080dcdfafd13996ee Mon Sep 17 00:00:00 2001 From: Chris McKnight Date: Fri, 7 Feb 2025 16:36:45 -0600 Subject: [PATCH 3/4] ci(actions): PHP extension setup --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7eedb7d..f51282e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,6 +32,7 @@ jobs: - uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-version }} + extensions: libsodium-1.0.2 - name: Cache multiple paths uses: actions/cache@v4 @@ -48,8 +49,6 @@ jobs: run: |- composer selfupdate sed -i s#\>=5.4.0#\>=5.3.0#g composer.json - pecl config-set php_dir ${{ runner.temp }} - ./bin/install-dependencies.sh composer install --prefer-source --no-ansi --no-interaction - name: Run tests From d3744064bb8b20df231a6f8727582631329f525b Mon Sep 17 00:00:00 2001 From: Chris McKnight Date: Fri, 7 Feb 2025 16:39:49 -0600 Subject: [PATCH 4/4] ci(actions): Use vendor phpunit --- .github/workflows/ci.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f51282e..142e0ee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: - ubuntu-latest - ubuntu-20.04 php-version: - - 7.1 + # - 7.1 - 7.2 - 7.3 - 8.0 @@ -33,6 +33,7 @@ jobs: with: php-version: ${{ matrix.php-version }} extensions: libsodium-1.0.2 + # tools: phpunit:4.x - name: Cache multiple paths uses: actions/cache@v4 @@ -52,7 +53,5 @@ jobs: composer install --prefer-source --no-ansi --no-interaction - name: Run tests - run: |- - phpunit - php vendor/bin/coveralls -v + run: php vendor/bin/phpunit