-
Notifications
You must be signed in to change notification settings - Fork 102
104 lines (100 loc) · 2.84 KB
/
ci.yaml
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
103
104
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_call:
permissions:
contents: read
name: CI
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- 'ubuntu-latest'
python-version:
- '3.10'
- '3.11'
- '3.12'
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{matrix.python-version}}
uses: actions/setup-python@v5
with:
python-version: ${{matrix.python-version}}
- name: Install msodbcsql18
run: |
sudo apt-get update
sudo apt-get install -y msodbcsql18
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e '.[dev]'
- uses: chartboost/ruff-action@v1
- name: Test with pytest
run: |
# -n0 disables parallel tests for more stability
pytest -n0
integration-tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- 'ubuntu-latest'
python-version:
- '3.11'
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{matrix.python-version}}
uses: actions/setup-python@v5
with:
python-version: ${{matrix.python-version}}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e '.' # do not install dev dependencies or other extras
- name: Test basic commands
run: |
datacontract --help
datacontract --version
docker:
runs-on: ubuntu-latest
needs:
- test
if: github.event_name != 'pull_request'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
datacontract/cli
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
# linux/arm64 is disabled
# duckdb currently does not support linux_arm64_gcc4
# https://duckdb.org/docs/extensions/working_with_extensions#platforms
platforms: linux/amd64,linux/arm64
push: ${{ github.ref == 'refs/heads/main' }}
tags: datacontract/cli:snapshot-latest
labels: ${{ steps.meta.outputs.labels }}