Skip to content

Commit d2f6e07

Browse files
committed
chore(ci): Add pre-release workflow
1 parent 18f3917 commit d2f6e07

2 files changed

Lines changed: 96 additions & 0 deletions

File tree

.github/workflows/prerelease.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: Prerelease tests
2+
3+
on:
4+
push:
5+
branches:
6+
- ci/prerelease
7+
schedule:
8+
- cron: '0 0 * * 1'
9+
# Allow job to be triggered manually from GitHub interface
10+
workflow_dispatch:
11+
12+
defaults:
13+
run:
14+
shell: bash
15+
16+
# Force tox and pytest to use color
17+
env:
18+
FORCE_COLOR: true
19+
20+
concurrency:
21+
group: ${{ github.workflow }}-${{ github.ref }}
22+
cancel-in-progress: true
23+
24+
permissions:
25+
contents: read
26+
27+
jobs:
28+
test:
29+
# Check each OS, all supported Python, minimum versions and latest releases
30+
runs-on: ${{ matrix.os }}
31+
strategy:
32+
matrix:
33+
os: ['ubuntu-latest']
34+
python-version: ['3.12', '3.13', '3.14']
35+
36+
env:
37+
DEPENDS: pre
38+
39+
steps:
40+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
41+
with:
42+
submodules: recursive
43+
fetch-depth: 0
44+
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
45+
with:
46+
path: ~/.cache/templateflow
47+
key: templateflow-v1
48+
- name: Install dependencies
49+
run: |
50+
sudo apt update
51+
sudo apt install -y --no-install-recommends graphviz
52+
- name: Install the latest version of uv
53+
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
54+
- name: Set up Python ${{ matrix.python-version }}
55+
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
56+
with:
57+
python-version: ${{ matrix.python-version }}
58+
- name: Display Python version
59+
run: python -c "import sys; print(sys.version)"
60+
- name: Install tox
61+
run: |
62+
uv tool install --with=tox-uv --with=tox-gh-actions tox
63+
- name: Show tox config
64+
run: tox c
65+
- name: Setup test suite
66+
run: tox run -vv --notest
67+
- name: Run test suite
68+
id: pre
69+
run: tox -v --skip-pkg-install --exit-and-dump-after 1200
70+
- name: Minimize uv cache
71+
run: uv cache prune --ci
72+
if: ${{ always() }}
73+
- name: Create issue
74+
# Workflows triggered by schedule only notify the workflow creator
75+
# So let's open an issue to make sure this is visible to all
76+
if: ${{ steps.pre.outcome != 'success' }}
77+
uses: JasonEtco/create-an-issue@1b14a70e4d8dc185e5cc76d3bec9eab20257b2c5 # v2.9.2
78+
env:
79+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80+
run_id: ${{ github.run_id }}
81+
repository: ${{ github.repository }}
82+
workflow_name: PRE-RELEASE TESTS
83+
with:
84+
filename: .github/workflow_failure.md
85+
update_existing: true
86+
search_existing: open
87+
- name: Return failure
88+
if: ${{ steps.pre.outcome != 'success' }}
89+
run: exit 1
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: ":rotating_light: {{ env.workflow_name }}: failure"
3+
---
4+
5+
The run `{{ env.run_id }}` of the workflow {{ env.workflow_name }} failed.
6+
7+
You can view [the log](https://github.com/{{ env.repository }}/actions/runs/{{ env.run_id }})

0 commit comments

Comments
 (0)