Repository navigation
101 lines (93 loc) · 3.05 KB
/
Copy pathci.yml
File metadata and controls
101 lines (93 loc) · 3.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: CI
on:
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
- converted_to_draft
merge_group:
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
defaults:
run:
shell: bash
jobs:
validate:
if: ${{ github.event_name != 'pull_request' || !github.event.pull_request.draft }}
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version-file: .bun-version
- run: bun install --frozen-lockfile
- run: bun run ci
test:
if: ${{ github.event_name != 'pull_request' || !github.event.pull_request.draft }}
runs-on: ${{ matrix.os }}
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
version: [1.178.2, latest, beta]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: ./
with:
version: ${{ matrix.version }}
- run: supabase -h
github-release-fallback:
if: ${{ github.event_name != 'pull_request' || !github.event.pull_request.draft }}
runs-on: ${{ matrix.os }}
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
# 2.33.0 predates versioned archive names; 2.122.0 uses them.
version: [2.33.0, 2.122.0]
env:
# An npm executable that does not exist makes every npm call fail.
SUPABASE_SETUP_CLI_NPM: setup-cli-npm-unavailable
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- id: setup-cli
uses: ./
with:
version: ${{ matrix.version }}
- env:
INSTALL_SOURCE: ${{ steps.setup-cli.outputs.install-source }}
INSTALLED_VERSION: ${{ steps.setup-cli.outputs.version }}
EXPECTED_VERSION: ${{ matrix.version }}
run: |
[[ "$INSTALL_SOURCE" == "github-release" ]]
[[ "$INSTALLED_VERSION" == "$EXPECTED_VERSION" ]]
supabase -h
ci:
if: ${{ always() && (github.event_name == 'pull_request' || github.event_name == 'merge_group') }}
name: CI
runs-on: ubuntu-latest
needs: [validate, test, github-release-fallback]
timeout-minutes: 5
steps:
- run: |
validate_result="${{ needs.validate.result }}"
test_result="${{ needs.test.result }}"
fallback_result="${{ needs.github-release-fallback.result }}"
[[ "$validate_result" == "success" || "$validate_result" == "skipped" ]]
[[ "$test_result" == "success" || "$test_result" == "skipped" ]]
[[ "$fallback_result" == "success" || "$fallback_result" == "skipped" ]]