forked from dbt-labs/dbt-adapters
-
Notifications
You must be signed in to change notification settings - Fork 0
102 lines (91 loc) · 3.81 KB
/
_verify-build.yml
File metadata and controls
102 lines (91 loc) · 3.81 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
102
# **what?**
# Verifies that packages can be built successfully and pass build checks.
# **why?**
# Ensures packages can be built and distributed before running more expensive tests.
# **when?**
# This workflow is called by other workflows (like _run-tests.yml and pull-request-checks.yml) or can be manually triggered via workflow_dispatch.
name: "# Verify build"
run-name: "Verify build - ${{ github.actor }} - package:${{ inputs.package }} branch:${{ inputs.branch }} repository:${{ inputs.repository }} os:${{ inputs.os }} python-version:${{ inputs.python-version }}"
on:
workflow_call:
inputs:
package:
description: "Choose the package to build"
type: string
default: "dbt-adapters"
branch:
description: "Choose the branch to build"
type: string
default: "main"
repository:
description: "Choose the repository to build, (used primarily when testing a fork)"
type: string
default: "dbt-labs/dbt-adapters"
os:
description: "Choose the OS to test against"
type: string
default: "ubuntu-22.04"
python-version:
description: "Choose the Python version to test against"
type: string
default: "3.10"
workflow_dispatch:
inputs:
package:
description: "Choose the package to build"
type: choice
options:
- "dbt-adapters"
- "dbt-tests-adapter"
- "dbt-athena"
- "dbt-athena-community"
- "dbt-bigquery"
- "dbt-postgres"
- "dbt-redshift"
- "dbt-snowflake"
- "dbt-spark"
branch:
description: "Choose the branch to build"
type: string
default: "main"
repository:
description: "Choose the repository to build, (used primarily when testing a fork)"
type: string
default: "dbt-labs/dbt-adapters"
os:
description: "Choose the OS to test against"
type: string
default: "ubuntu-22.04"
python-version:
description: "Choose the Python version to test against"
type: choice
options: ["3.10", "3.11", "3.12"]
permissions:
contents: read
defaults:
run:
shell: bash
jobs:
build:
runs-on: ${{ inputs.os }}
name: "build - ${{ inputs.package }} - ${{ inputs.branch }} - ${{ inputs.os }} - ${{ inputs.python-version }}"
steps:
- name: "Checkout ${{ inputs.branch }}"
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # actions/checkout@v4
with:
ref: ${{ inputs.branch }}
repository: ${{ inputs.repository }}
submodules: true
- name: "Set up Python"
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
- name: "Set environment variables"
run: |
echo "HATCH_PYTHON=${{ inputs.python-version }}" >> $GITHUB_ENV
echo "PIP_ONLY_BINARY=psycopg2-binary" >> $GITHUB_ENV
- name: "Install hatch"
uses: pypa/hatch@257e27e51a6a5616ed08a39a408a21c35c9931bc # pypa/hatch@install
- name: "Build and verify package"
run: hatch build && hatch run build:check-all
working-directory: ./${{ inputs.package }}