Skip to content

Commit 9971379

Browse files
committed
Add pre-release tests in github action
1 parent 09d9fc4 commit 9971379

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Testing the code base against the MeiliSearch pre-releases
2+
name: Pre-Release Tests
3+
4+
# Will only run for PRs and pushes to bump-meilisearch-v*
5+
on:
6+
push:
7+
branches: bump-meilisearch-v*
8+
pull_request:
9+
branches: bump-meilisearch-v*
10+
11+
jobs:
12+
integration-tests:
13+
name: integration-tests-against-rc
14+
runs-on: ubuntu-latest
15+
strategy:
16+
matrix:
17+
php-versions: ['7.4', '8.0']
18+
name: integration-tests-against-rc (PHP ${{ matrix.php-versions }})
19+
steps:
20+
- uses: actions/checkout@v2
21+
- name: Install PHP
22+
uses: shivammathur/setup-php@v2
23+
with:
24+
php-version: ${{ matrix.php-versions }}
25+
- name: Validate composer.json and composer.lock
26+
run: composer validate
27+
- name: Install dependencies
28+
run: composer install --prefer-dist --no-progress --quiet
29+
- name: Get the latest MeiliSearch RC
30+
run: echo "MEILISEARCH_VERSION=$(curl https://raw.githubusercontent.com/meilisearch/integration-guides/main/scripts/get-latest-meilisearch-rc.sh | bash)" >> $GITHUB_ENV
31+
- name: MeiliSearch (${{ env.MEILISEARCH_VERSION }}) setup with Docker
32+
run: docker run -d -p 7700:7700 getmeili/meilisearch:${{ env.MEILISEARCH_VERSION }} ./meilisearch --master-key=masterKey --no-analytics=true
33+
- name: Check
34+
run: curl http://127.0.0.1:7700
35+
- name: Run test suite
36+
run: composer test:unit

.github/workflows/tests.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ on:
1111

1212
jobs:
1313
integration-tests:
14+
name: integration-tests
15+
# Will not run if the event is a PR to bump-meilisearch-v* (so a pre-release PR)
16+
# Will still run for each push to bump-meilisearch-v*
17+
if: github.event_name != 'pull_request' || !startsWith(github.base_ref, 'bump-meilisearch-v')
1418
runs-on: ubuntu-latest
1519
strategy:
1620
matrix:

0 commit comments

Comments
 (0)