Skip to content

Commit fe1d7e4

Browse files
bors[bot]bidoubiwa
andauthored
Merge #536
536: Add pre release tests r=bidoubiwa a=bidoubiwa Co-authored-by: Charlotte Vermandel <[email protected]>
2 parents 7b7d013 + 31b0a52 commit fe1d7e4

File tree

2 files changed

+82
-0
lines changed

2 files changed

+82
-0
lines changed
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
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+
tests:
13+
runs-on: ubuntu-latest
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
node: ["12", "14"]
18+
name: Tests (Node.js ${{ matrix.node }})
19+
steps:
20+
- uses: actions/checkout@v2
21+
- name: Setup node
22+
uses: actions/setup-node@v2
23+
with:
24+
node-version: ${{ matrix.node }}
25+
- name: Install dependencies
26+
run: yarn install
27+
- name: Build
28+
run: yarn run build
29+
- name: Run tests
30+
run: yarn run test
31+
32+
cypress-run:
33+
runs-on: ubuntu-latest
34+
# Browser on which the tests are run
35+
container: cypress/browsers:node12.18.3-chrome87-ff82
36+
steps:
37+
- name: Checkout
38+
uses: actions/checkout@v2
39+
- name: Cache dependencies
40+
uses: actions/cache@v2
41+
with:
42+
path: |
43+
./node_modules
44+
key: ${{ hashFiles('yarn.lock') }}
45+
- name: Setup node
46+
uses: actions/setup-node@v2
47+
with:
48+
node-version: "14.x"
49+
- name: Install dependencies
50+
run: yarn --dev && yarn --cwd ./tests/env/browser
51+
- name: Grep latest version of Meilisearch
52+
run: |
53+
echo "MEILISEARCH_LATEST=$(curl https://raw.githubusercontent.com/meilisearch/integration-guides/main/scripts/get-latest-meilisearch-rc.sh | sh)" >> $GITHUB_ENV
54+
- name: Download Meilisearch
55+
run: |
56+
curl https://github.com/meilisearch/meilisearch/releases/download/${{ env.MEILISEARCH_LATEST }}/meilisearch-linux-amd64 --output meilisearch --location
57+
chmod +x meilisearch
58+
- name: Run Meilisearch
59+
run: |
60+
./meilisearch --master-key=masterKey --no-analytics true &
61+
- name: Browser tests
62+
uses: cypress-io/github-action@v2
63+
with:
64+
# Your starting script
65+
start: yarn test:browser
66+
# Creates and uploads GitHub artifacts in case of failure
67+
- uses: actions/upload-artifact@v2
68+
if: failure()
69+
with:
70+
name: cypress-screenshots
71+
path: cypress/screenshots
72+
- uses: actions/upload-artifact@v2
73+
if: failure()
74+
with:
75+
name: cypress-videos
76+
path: cypress/videos

.github/workflows/tests.yml

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

1212
jobs:
1313
tests:
14+
# Will not run if the event is a PR to bump-meilisearch-v* (so a pre-release PR)
15+
# Will still run for each push to bump-meilisearch-v*
16+
if: github.event_name != 'pull_request' || !startsWith(github.base_ref, 'bump-meilisearch-v')
1417
runs-on: ubuntu-latest
1518
strategy:
1619
fail-fast: false
@@ -41,6 +44,9 @@ jobs:
4144
run: yarn run lint
4245

4346
cypress-run:
47+
# Will not run if the event is a PR to bump-meilisearch-v* (so a pre-release PR)
48+
# Will still run for each push to bump-meilisearch-v*
49+
if: github.event_name != 'pull_request' || !startsWith(github.base_ref, 'bump-meilisearch-v')
4450
runs-on: ubuntu-latest
4551
# Browser on which the tests are run
4652
container: cypress/browsers:node12.18.3-chrome87-ff82

0 commit comments

Comments
 (0)