From 27b24f3fff0aeba3490985b9068ecf26935ac2c8 Mon Sep 17 00:00:00 2001 From: Kirill Morozov Date: Thu, 14 Jan 2021 06:11:59 +0300 Subject: [PATCH 1/3] Add Github Actions CI/CD --- .github/workflows/c-cpp.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/c-cpp.yml diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml new file mode 100644 index 00000000..8f208bd8 --- /dev/null +++ b/.github/workflows/c-cpp.yml @@ -0,0 +1,25 @@ +name: C/C++ CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: install PHP + run: > + sudo apt install software-properties-common && \ + sudo add-apt-repository ppa:ondrej/php && \ + sudo apt-get update \ + sudo apt-get install php7.4 php7.4-dev + - name: make + run: make + - name: make install + run: sudo make install From 663ca666aebb5ba0ab072b1348b94e099932c1b3 Mon Sep 17 00:00:00 2001 From: Kirill Morozov Date: Thu, 14 Jan 2021 06:22:27 +0300 Subject: [PATCH 2/3] Build using different php versions. --- .github/workflows/c-cpp.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 8f208bd8..422d90f7 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -8,9 +8,11 @@ on: jobs: build: - - runs-on: ubuntu-latest - + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ ubuntu-16.04, ubuntu-latest ] + php: [ '7.4', '8.0' ] steps: - uses: actions/checkout@v2 - name: install PHP @@ -18,7 +20,9 @@ jobs: sudo apt install software-properties-common && \ sudo add-apt-repository ppa:ondrej/php && \ sudo apt-get update \ - sudo apt-get install php7.4 php7.4-dev + sudo apt-get install php$PHP_VERSION php$PHP_VERSION-dev + env: + PHP_VERSION: ${{ matrix.php }} - name: make run: make - name: make install From 025c999e39dc0aebc9a42a98ce49006bd631d739 Mon Sep 17 00:00:00 2001 From: Kirill Morozov Date: Thu, 14 Jan 2021 06:38:18 +0300 Subject: [PATCH 3/3] Change php installation tool --- .github/workflows/c-cpp.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 422d90f7..b69f44ec 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -15,14 +15,10 @@ jobs: php: [ '7.4', '8.0' ] steps: - uses: actions/checkout@v2 - - name: install PHP - run: > - sudo apt install software-properties-common && \ - sudo add-apt-repository ppa:ondrej/php && \ - sudo apt-get update \ - sudo apt-get install php$PHP_VERSION php$PHP_VERSION-dev - env: - PHP_VERSION: ${{ matrix.php }} + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} - name: make run: make - name: make install