Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 31 additions & 4 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ on:
- cron: '6 2 * * *'
workflow_dispatch:

# A new push to the same PR cancels the previous run. Runs on main (pushes
# and the nightly schedule) are never cancelled: releases use their artifacts.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

permissions:
contents: read

jobs:
build-installer:
name: Build installer
Expand All @@ -31,6 +40,8 @@ jobs:
os: macos-15-intel
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: prefix-dev/setup-pixi@ad1da6449d9e506fd127fd67ab2d054a769f6a94 # v0.11.2
with:
cache: true
Expand Down Expand Up @@ -59,7 +70,7 @@ jobs:
run: |
bash DIRACOS-*.sh
source diracos/diracosrc
conda env export --file environment.yaml --prefix $DIRACOS
micromamba env export --prefix "$DIRACOS" > environment.yaml
- name: Upload environment.yaml
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
Expand All @@ -74,6 +85,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: prefix-dev/setup-pixi@ad1da6449d9e506fd127fd67ab2d054a769f6a94 # v0.11.2
with:
cache: true
Expand All @@ -83,9 +96,11 @@ jobs:
with:
path: artifacts
- name: Create release notes
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
pixi run -e release release-notes \
--token="${{ secrets.GITHUB_TOKEN }}" \
--token="${GH_TOKEN}" \
--artifacts-dir="${PWD}/artifacts" \
> release-notes.md
cat release-notes.md
Expand Down Expand Up @@ -122,12 +137,16 @@ jobs:

steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Download installer
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: ${{ matrix.installer }}
- name: Run tests
run: scripts/run_basic_tests.sh ${{ matrix.docker_image }} DIRACOS-*.sh
env:
DOCKER_IMAGE: ${{ matrix.docker_image }}
run: scripts/run_basic_tests.sh "$DOCKER_IMAGE" DIRACOS-*.sh

macos-64-tests:
name: macOS (x86_64) tests
Expand All @@ -140,6 +159,8 @@ jobs:
os: [macos-15-intel]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Download installer
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
Expand All @@ -162,6 +183,8 @@ jobs:
os: [macos-15, macos-26]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Download installer
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
Expand All @@ -187,6 +210,8 @@ jobs:
- integration
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: '3.15'
Expand All @@ -195,9 +220,11 @@ jobs:
with:
name: installer-linux-64
- name: Prepare environment
env:
DIRAC_BRANCH: ${{ matrix.dirac-branch }}
run: |
pip install typer pyyaml gitpython packaging
git clone https://github.com/DIRACGrid/DIRAC.git -b "${{ matrix.dirac-branch }}" DIRACRepo
git clone https://github.com/DIRACGrid/DIRAC.git -b "${DIRAC_BRANCH}" DIRACRepo
- name: Run tests
run: |
DIRACOS_TARBALL_PATH=$(echo ${PWD}/DIRACOS-*.sh)
Expand Down
26 changes: 23 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,40 @@ on:
required: false
default: ''

# Never cancel a running release. GitHub keeps only one pending run per group,
# so a newer dispatch replaces a queued (not yet started) one.
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false

permissions:
contents: read

jobs:
create-release:
name: create-release
if: github.repository == 'DIRACGrid/DIRACOS2'
runs-on: ubuntu-latest
# The release is created with secrets.GH_TOKEN, not the GITHUB_TOKEN.
permissions:
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: prefix-dev/setup-pixi@ad1da6449d9e506fd127fd67ab2d054a769f6a94 # v0.11.2
with:
cache: true
environments: release
- name: Create release
env:
# zizmor: ignore[secrets-outside-env] release creation; no GitHub environment needed
GH_TOKEN: ${{ secrets.GH_TOKEN }}
RUN_ID: ${{ github.event.inputs.run_id }}
VERSION_INPUT: ${{ github.event.inputs.version }}
run: |
pixi run -e release release-notes \
--token="${{ secrets.GH_TOKEN }}" \
--run-id="${{ github.event.inputs.run_id }}" \
--version="${{ github.event.inputs.version }}" \
--token="${GH_TOKEN}" \
--run-id="${RUN_ID}" \
--version="${VERSION_INPUT}" \
--make-release
12 changes: 9 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,24 @@
# See https://pre-commit.com/hooks.html for more hooks

default_language_version:
python: python3.9
python: python3

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
rev: v6.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files

- repo: https://github.com/psf/black
rev: 21.9b0
rev: 26.10.1
hooks:
- id: black

- repo: https://github.com/zizmorcore/zizmor-pre-commit
rev: v1.32.0
hooks:
- id: zizmor
args: ["--no-online-audits"]
2 changes: 1 addition & 1 deletion scripts/make_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"linux-64": "Linux-x86_64",
"linux-aarch64": "Linux-aarch64",
"osx-64": "Darwin-x86_64",
"osx-arm64": "Darwin-arm64"
"osx-arm64": "Darwin-arm64",
}
logging.basicConfig(level=logging.INFO)

Expand Down
2 changes: 1 addition & 1 deletion scripts/run_basic_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ exec docker run --rm --privileged -v "${PWD}":/diracos-repo "${IMAGE_NAME}" bash
if ! command -v sudo >/dev/null 2>&1; then
yum install -y sudo
fi

# Install as a non-root user with a read-only $HOME so that DIRACGrid/DIRACOS2#174
# (installer failing on mkdir ~/.conda when $HOME is not writable) would be
# reproduced here. Root ignores permission bits, so this check only works as
Expand Down
1 change: 1 addition & 0 deletions tests/test_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"""
Some imports to make sure that the DIRACOS environment is complete
"""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
Expand Down
Loading