From 86e6ecab335aef5e45246b34b7fa5f01c17ae300 Mon Sep 17 00:00:00 2001 From: Oliver Radwell Date: Wed, 14 Dec 2022 10:07:07 +0000 Subject: [PATCH] GitHub Actions (#1) --- .circleci/config.yml | 37 --------------------------------- .github/workflows/ci-build.yml | 38 ++++++++++++++++++++++++++++++++++ README.md | 2 +- 3 files changed, 39 insertions(+), 38 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/ci-build.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 7adf3e1..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,37 +0,0 @@ -# PHP CircleCI 2.0 configuration file -# -# Check https://circleci.com/docs/2.0/language-php/ for more details -# -version: 2 -jobs: - build: - docker: - # specify the version you desire here - - image: circleci/php:7.1-node-browsers - - # Specify service dependencies here if necessary - # CircleCI maintains a library of pre-built images - # documented at https://circleci.com/docs/2.0/circleci-images/ - # - image: circleci/mysql:9.4 - - working_directory: ~/repo - - steps: - - checkout - - # Download and cache dependencies - - restore_cache: - keys: - - v1-dependencies-{{ checksum "composer.json" }} - # fallback to using the latest cache if no exact match is found - - v1-dependencies- - - - run: composer install -n --prefer-dist - - - save_cache: - paths: - - ./vendor - key: v1-dependencies-{{ checksum "composer.json" }} - - # run tests! - - run: ./vendor/bin/phpunit \ No newline at end of file diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml new file mode 100644 index 0000000..5f33448 --- /dev/null +++ b/.github/workflows/ci-build.yml @@ -0,0 +1,38 @@ +name: Build + +on: + push: + branches: [ master ] + pull_request: + +permissions: + contents: read + +jobs: + build: + name: Build + runs-on: ubuntu-22.04 + + steps: + - uses: actions/checkout@v3 + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: "7.1" + coverage: none + - name: Prepare composer cache + id: composer-cache + run: | + COMPOSER_CACHE_DIR=$(composer config cache-files-dir) + mkdir -p ${COMPOSER_CACHE_DIR} + echo "dir=${COMPOSER_CACHE_DIR}" >> ${GITHUB_OUTPUT} + - name: Cache dependencies + uses: actions/cache@v3 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} + restore-keys: ${{ runner.os }}-composer- + - name: Install dependencies + run: composer install --no-interaction + - name: Run PHPUnit + run: vendor/bin/phpunit diff --git a/README.md b/README.md index be4d172..a12ab2a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Lemmatizer -[![Circle CI](https://circleci.com/gh/writecrow/lemmatizer.svg?style=shield)](https://circleci.com/gh/writecrow/lemmatizer) +[![Build](https://github.com/AmaraLiving/lemmatizer/actions/workflows/ci-build.yml/badge.svg)](https://github.com/AmaraLiving/lemmatizer/actions/workflows/ci-build.yml) A PHP library for getting a lemma from a given word, and getting a list of words that map to a lemma. This does NOT support part of speech specification.