mirror of
https://github.com/supabase/supabase.git
synced 2026-07-04 15:24:24 +08:00
93 lines
2.5 KiB
YAML
93 lines
2.5 KiB
YAML
# This is a basic workflow to help you get started with Actions
|
|
name: Tests
|
|
|
|
# Controls when the workflow will run
|
|
on:
|
|
# Triggers the workflow on push or pull request events but only for the main branch
|
|
push:
|
|
branches: [master]
|
|
pull_request:
|
|
branches: [master]
|
|
|
|
# Allows you to run this workflow manually from the Actions tab
|
|
workflow_dispatch:
|
|
|
|
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
|
jobs:
|
|
autotests:
|
|
name: Run tests and generate Allure Report
|
|
strategy:
|
|
matrix:
|
|
node: ['14']
|
|
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: ./tests
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Set up JDK
|
|
uses: actions/setup-java@v1
|
|
with:
|
|
java-version: 1.8
|
|
|
|
- name: Set up Node
|
|
uses: actions/setup-node@v1
|
|
with:
|
|
node-version: ${{ matrix.node }}
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Run infrastructure
|
|
run: |
|
|
cp ../docker/.env.example ../docker/.env
|
|
npm run docker:up
|
|
|
|
- name: Run Test
|
|
run: npm run test
|
|
|
|
- name: Stop infrastructure
|
|
if: always()
|
|
run: npm run docker:down
|
|
|
|
- name: Get Allure history
|
|
uses: actions/checkout@v2
|
|
if: always()
|
|
continue-on-error: true
|
|
with:
|
|
repository: supabase/test-reports
|
|
ref: gh-pages
|
|
path: gh-pages
|
|
|
|
- name: Allure Report action
|
|
uses: simple-elf/allure-report-action@master
|
|
if: always()
|
|
with:
|
|
github_repo: test-reports
|
|
allure_results: tests/allure-results
|
|
allure_history: allure-history
|
|
subfolder: supabase-integration
|
|
keep_reports: 50
|
|
|
|
- name: Deploy report to Github Pages
|
|
if: ${{ !github.event.pull_request.head.repo.fork }}
|
|
uses: peaceiris/actions-gh-pages@v2
|
|
env:
|
|
EXTERNAL_REPOSITORY: supabase/test-reports
|
|
ACTIONS_DEPLOY_KEY: ${{ secrets.DEPLOY_TO_TEST_REPORTS_KEY }}
|
|
PUBLISH_BRANCH: gh-pages
|
|
PUBLISH_DIR: allure-history
|
|
|
|
- name: Post the link to the report
|
|
if: ${{ !github.event.pull_request.head.repo.fork }}
|
|
uses: Sibz/github-status-action@v1
|
|
with:
|
|
authToken: ${{ secrets.GITHUB_TOKEN }}
|
|
context: 'Test report'
|
|
state: 'success'
|
|
sha: ${{ github.event.pull_request.head.sha || github.sha }}
|
|
target_url: https://supabase.github.io/test-reports/supabase-integration/${{ github.run_number }}
|