Skip to content

Commit 6917e93

Browse files
committed
WIP CI
1 parent a982ad2 commit 6917e93

File tree

1 file changed

+4
-196
lines changed

1 file changed

+4
-196
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 196 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ jobs:
6262
if: ${{ env.B2_TEST_APPLICATION_KEY != '' && env.B2_TEST_APPLICATION_KEY_ID != '' }} # TODO: skip this whole job instead
6363
with:
6464
fetch-depth: 0
65+
- name: Setup tmate session
66+
uses: mxschmitt/action-tmate@v3
67+
with:
68+
limit-access-to-actor: true
6569
- name: Set up Python ${{ env.PYTHON_DEFAULT_VERSION }}
6670
if: ${{ env.B2_TEST_APPLICATION_KEY != '' && env.B2_TEST_APPLICATION_KEY_ID != '' }} # TODO: skip this whole job instead
6771
uses: actions/setup-python@v5
@@ -74,199 +78,3 @@ jobs:
7478
- name: Find and remove old buckets
7579
if: ${{ env.B2_TEST_APPLICATION_KEY != '' && env.B2_TEST_APPLICATION_KEY_ID != '' }} # TODO: skip this whole job instead
7680
run: nox -vs cleanup_buckets
77-
test:
78-
timeout-minutes: 90
79-
needs: cleanup_buckets
80-
env:
81-
B2_TEST_APPLICATION_KEY: ${{ secrets.B2_TEST_APPLICATION_KEY }}
82-
B2_TEST_APPLICATION_KEY_ID: ${{ secrets.B2_TEST_APPLICATION_KEY_ID }}
83-
WORKFLOW_ID: ${{ github.run_id }}-${{ github.run_attempt }}-${{ matrix.os }}
84-
runs-on: ${{ matrix.os }}
85-
strategy:
86-
fail-fast: false
87-
matrix:
88-
os: ["ubuntu-latest", "ubuntu-24.04-arm", "macos-latest", "windows-latest"]
89-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "pypy3.9", "pypy3.10"]
90-
exclude:
91-
- os: "macos-latest"
92-
python-version: "pypy3.10"
93-
- os: "windows-latest"
94-
python-version: "pypy3.10"
95-
# Workaround for https://github.com/actions/setup-python/issues/696
96-
- os: "macos-latest"
97-
python-version: 3.8
98-
- os: "macos-latest"
99-
python-version: 3.9
100-
include:
101-
# Workaround for https://github.com/actions/setup-python/issues/696
102-
- os: "macos-13"
103-
python-version: 3.8
104-
- os: "macos-13"
105-
python-version: 3.9
106-
steps:
107-
- uses: actions/checkout@v4
108-
with:
109-
fetch-depth: 0
110-
- name: Set up Python ${{ matrix.python-version }}
111-
uses: actions/setup-python@v5
112-
with:
113-
python-version: ${{ matrix.python-version }}
114-
- name: Install test binary dependencies
115-
if: startsWith(matrix.os, 'ubuntu')
116-
run: |
117-
sudo apt-get -y update
118-
sudo apt-get -y install zsh fish
119-
sudo chmod -R 755 /usr/share/zsh/vendor-completions /usr/share/zsh # Fix permissions for zsh completions
120-
- name: Install test binary dependencies (macOS)
121-
if: startsWith(matrix.os, 'macos')
122-
run: |
123-
brew install fish
124-
- name: Install dependencies
125-
run: python -m pip install --upgrade nox pdm
126-
- name: Run unit tests
127-
run: nox -vs unit -p ${{ matrix.python-version }}
128-
- name: Run integration tests (without secrets)
129-
run: nox -vs integration -p ${{ matrix.python-version }} -- -m "not require_secrets"
130-
- name: Run integration tests (with secrets)
131-
# Limit CI workload by running integration tests with secrets only on edge Python versions.
132-
if: ${{ env.B2_TEST_APPLICATION_KEY != '' && env.B2_TEST_APPLICATION_KEY_ID != '' && contains(fromJSON('["3.8", "pypy3.10", "3.13"]'), matrix.python-version) }}
133-
run: nox -vs integration -p ${{ matrix.python-version }} -- -m "require_secrets" --cleanup
134-
test-docker:
135-
timeout-minutes: 90
136-
needs: cleanup_buckets
137-
env:
138-
B2_TEST_APPLICATION_KEY: ${{ secrets.B2_TEST_APPLICATION_KEY }}
139-
B2_TEST_APPLICATION_KEY_ID: ${{ secrets.B2_TEST_APPLICATION_KEY_ID }}
140-
WORKFLOW_ID: ${{ github.run_id }}-${{ github.run_attempt }}-${{ github.job }}
141-
runs-on: ubuntu-latest
142-
steps:
143-
- uses: actions/checkout@v4
144-
with:
145-
fetch-depth: 0
146-
- name: Set up Python ${{ env.PYTHON_DEFAULT_VERSION }}
147-
uses: actions/setup-python@v5
148-
with:
149-
python-version: ${{ env.PYTHON_DEFAULT_VERSION }}
150-
- name: Install dependencies
151-
run: python -m pip install --upgrade nox pdm
152-
- name: Generate Dockerfile
153-
run: nox -vs generate_dockerfile
154-
- name: Set up QEMU
155-
uses: docker/setup-qemu-action@v3
156-
- name: Set up Docker Buildx
157-
uses: docker/setup-buildx-action@v3
158-
- name: Build Docker
159-
uses: docker/build-push-action@v5
160-
with:
161-
context: .
162-
load: true
163-
tags: backblazeit/b2:test
164-
platforms: linux/amd64
165-
- name: Run tests with docker
166-
if: ${{ env.B2_TEST_APPLICATION_KEY != '' && env.B2_TEST_APPLICATION_KEY_ID != '' }}
167-
run: nox -vs docker_test -- backblazeit/b2:test
168-
test-linux-bundle:
169-
timeout-minutes: 90
170-
needs: cleanup_buckets
171-
env:
172-
B2_TEST_APPLICATION_KEY: ${{ secrets.B2_TEST_APPLICATION_KEY }}
173-
B2_TEST_APPLICATION_KEY_ID: ${{ secrets.B2_TEST_APPLICATION_KEY_ID }}
174-
WORKFLOW_ID: ${{ github.run_id }}-${{ github.run_attempt }}-${{ github.job }}
175-
runs-on: ${{ matrix.os }}
176-
strategy:
177-
fail-fast: false
178-
matrix:
179-
os: ["ubuntu-22.04", "ubuntu-22.04-arm"] # keep the versions aligned with cd.yml
180-
steps:
181-
- uses: actions/checkout@v4
182-
with:
183-
fetch-depth: 0
184-
- name: Set up Python ${{ env.PYTHON_DEFAULT_VERSION }}
185-
uses: deadsnakes/[email protected] # staticx doesn't work with python installed by setup-python action
186-
with:
187-
python-version: ${{ env.PYTHON_DEFAULT_VERSION }}
188-
- name: Install dependencies
189-
run: |
190-
sudo apt-get -y update
191-
sudo apt-get -y install patchelf scons
192-
python -m pip install --upgrade nox pdm
193-
git config --global --add safe.directory '*'
194-
- name: Bundle the distribution
195-
id: bundle
196-
shell: bash
197-
run: nox -vs bundle
198-
- name: Generate hashes
199-
id: hashes
200-
run: nox -vs make_dist_digest
201-
- name: Run integration tests (without secrets)
202-
run: nox -vs integration -p ${{ env.PYTHON_DEFAULT_VERSION }} -- --sut=${{ steps.bundle.outputs.sut_path }} -m "not require_secrets"
203-
- name: Run integration tests (with secrets)
204-
if: ${{ env.B2_TEST_APPLICATION_KEY != '' && env.B2_TEST_APPLICATION_KEY_ID != '' }}
205-
run: nox -vs integration -p ${{ env.PYTHON_DEFAULT_VERSION }} -- --sut=${{ steps.bundle.outputs.sut_path }} -m "require_secrets" --cleanup
206-
- name: Upload assets
207-
if: failure()
208-
uses: actions/upload-artifact@v4
209-
with:
210-
path: ${{ steps.bundle.outputs.asset_path }}
211-
if-no-files-found: warn
212-
retention-days: 7
213-
overwrite: true
214-
test-windows-bundle:
215-
timeout-minutes: 90
216-
needs: cleanup_buckets
217-
env:
218-
B2_TEST_APPLICATION_KEY: ${{ secrets.B2_TEST_APPLICATION_KEY }}
219-
B2_TEST_APPLICATION_KEY_ID: ${{ secrets.B2_TEST_APPLICATION_KEY_ID }}
220-
WORKFLOW_ID: ${{ github.run_id }}-${{ github.run_attempt }}-${{ github.job }}
221-
runs-on: windows-2022 # keep the version aligned with cd.yml
222-
steps:
223-
- uses: actions/checkout@v4
224-
with:
225-
fetch-depth: 0
226-
- name: Set up Python ${{ env.PYTHON_DEFAULT_VERSION }}
227-
uses: actions/setup-python@v5
228-
with:
229-
python-version: ${{ env.PYTHON_DEFAULT_VERSION }}
230-
- name: Install dependencies
231-
run: python -m pip install --upgrade nox pdm
232-
- name: Bundle the distribution
233-
id: bundle
234-
shell: bash
235-
run: nox -vs bundle
236-
- name: Generate hashes
237-
id: hashes
238-
run: nox -vs make_dist_digest
239-
- name: Run integration tests (without secrets)
240-
run: nox -vs integration -p ${{ env.PYTHON_DEFAULT_VERSION }} -- --sut=${{ steps.bundle.outputs.sut_path }} -m "not require_secrets"
241-
- name: Run integration tests (with secrets)
242-
if: ${{ env.B2_TEST_APPLICATION_KEY != '' && env.B2_TEST_APPLICATION_KEY_ID != '' }}
243-
run: nox -vs integration -p ${{ env.PYTHON_DEFAULT_VERSION }} -- --sut=${{ steps.bundle.outputs.sut_path }} -m "require_secrets" --cleanup
244-
- name: Upload assets
245-
if: failure()
246-
uses: actions/upload-artifact@v4
247-
with:
248-
path: ${{ steps.bundle.outputs.asset_path }}
249-
if-no-files-found: warn
250-
retention-days: 7
251-
overwrite: true
252-
doc:
253-
timeout-minutes: 30
254-
needs: build
255-
runs-on: ubuntu-latest
256-
steps:
257-
- uses: actions/checkout@v4
258-
with:
259-
fetch-depth: 0
260-
- name: Set up Python ${{ env.PYTHON_DEFAULT_VERSION }}
261-
uses: actions/setup-python@v5
262-
with:
263-
python-version: ${{ env.PYTHON_DEFAULT_VERSION }}
264-
- name: Install dependencies
265-
env:
266-
DEBIAN_FRONTEND: noninteractive
267-
run: |
268-
sudo apt-get update -y
269-
sudo apt-get install -y graphviz plantuml
270-
python -m pip install --upgrade nox pdm
271-
- name: Build the docs
272-
run: nox --non-interactive -vs doc

0 commit comments

Comments
 (0)