Skip to content

Commit

Permalink
Configure CI.
Browse files Browse the repository at this point in the history
  • Loading branch information
joaander committed May 20, 2024
1 parent 6e13c8a commit e5bde6c
Show file tree
Hide file tree
Showing 22 changed files with 628 additions and 46 deletions.
42 changes: 42 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Bug report
description: Report a problem with row.
labels: ['bug']
body:
- type: textarea
attributes:
label: Description
description: Describe the problem.
validations:
required: true
- type: textarea
attributes:
label: Steps to reproduce
description: |
What specific commands do you execute to trigger the problem?
placeholder: |
row show status
...
render: shell
- type: textarea
attributes:
label: Input files
description: Attach any input files needed to execute the above steps.
- type: textarea
attributes:
label: Output
description: |
What output did you get?
render: shell
- type: textarea
attributes:
label: Expected output
description: What output do you expect?
- type: input
attributes:
label: Row version
description: What version of **row** are you using?
placeholder: 0.1.0
- type: markdown
attributes:
value: |
Execute `row --version` to find your **row** version.
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
blank_issues_enabled: true
contact_links:
- name: Row discussion board
url: https://github.com/glotzerlab/row/discussions/
about: Ask the Row user community for help.
- name: Row documentation
url: https://row.readthedocs.io/
about: User documentation.
25 changes: 25 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Feature request
description: Suggest a new **row** feature
labels: ['enhancement']
body:
- type: textarea
attributes:
label: Description
description: What new capability would you like in **row**?
validations:
required: true
- type: textarea
attributes:
label: Proposed solution
description: How should this capability be implemented? What might user interface look like?
- type: textarea
attributes:
label: Additional context
description: What additional information is helpful to understand this request?
- type: markdown
attributes:
value: |
We would welcome your contribution!
If you plan to implement this functionality, the **row** developers will discuss the
proposed design and API with you **before** you begin work.
16 changes: 16 additions & 0 deletions .github/ISSUE_TEMPLATE/task.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Task
description: A task that needs to be completed
labels: ['task']
body:
- type: textarea
attributes:
label: Description
description: What needs to be done?
validations:
required: true
- type: textarea
attributes:
label: Motivation and context
description: What additional information is helpful to understand this task?
validations:
required: true
27 changes: 27 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
## Description

<!-- Describe your changes. -->

## Motivation and context

<!--- Why is this change required? What problem does it solve? -->

<!-- Replace ??? with the issue number that this pull request resolves. -->
Resolves #???

## How has this been tested?

<!--- Please describe how you tested your changes. -->

## Change log

<!-- Propose a change log entry. -->
```
```

## Checklist:

- [ ] I have reviewed the [**Contributor Guidelines**](https://github.com/glotzerlab/row/blob/trunk/doc/src/developers/contributing.md).
- [ ] I agree with the terms of the [**Row Contributor Agreement**](https://github.com/glotzerlab/row/blob/trunk/ContributorAgreement.md).
- [ ] My name is on the list of contributors (`doc/src/contributors.md`) in the pull request source branch.
77 changes: 77 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
target-branch: trunk
schedule:
interval: "monthly"
time: "07:00"
timezone: "EST5EDT"
pull-request-branch-name:
separator: "-"
open-pull-requests-limit: 2
reviewers:
- joaander
groups:
actions-version:
applies-to: version-updates
patterns:
- '*'
actions-security:
applies-to: security-updates
patterns:
- '*'
- package-ecosystem: "pip"
directory: "/"
target-branch: trunk
schedule:
interval: "monthly"
time: "07:00"
timezone: "EST5EDT"
pull-request-branch-name:
separator: "-"
open-pull-requests-limit: 2
reviewers:
- joaander
groups:
pip-version:
applies-to: version-updates
patterns:
- '*'
update-types:
- minor
- patch
pip-security:
applies-to: security-updates
patterns:
- '*'
update-types:
- minor
- patch
- package-ecosystem: "cargo"
directory: "/"
target-branch: trunk
schedule:
interval: "monthly"
time: "07:00"
timezone: "EST5EDT"
pull-request-branch-name:
separator: "-"
open-pull-requests-limit: 2
reviewers:
- joaander
groups:
pip-version:
applies-to: version-updates
patterns:
- '*'
update-types:
- minor
- patch
pip-security:
applies-to: security-updates
patterns:
- '*'
update-types:
- minor
- patch
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit-requirements.in
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pre-commit==3.7.0
pre-commit==3.7.1
17 changes: 15 additions & 2 deletions .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,22 @@ on:

workflow_dispatch:

env:
RUST_VERSION: 1.78.0

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.3
# For unknown reasons, pre-commit fails with error: component download failed for cargo-x86_64-unknown-linux-gnu: could not rename downloaded file ...
# unless we install with rustup first manually.
- name: Update rust
run: rustup install "$RUST_VERSION" --no-self-update && rustup default "${RUST_VERSION}"
- name: Install rustfmt
run: rustup component add rustfmt
- name: Install clippy
run: rustup component add clippy
- uses: actions/cache@v4.0.2
with:
path: |
Expand All @@ -25,5 +36,7 @@ jobs:
- uses: actions/setup-python@v5.0.0
with:
python-version: '3.12'
- run: pip install -r .github/workflows/pre-commit-requirements.txt
- run: pre-commit run --all-files
- name: Install pre-commit
run: pip install -r .github/workflows/pre-commit-requirements.txt
- name: Run pre-commit
run: pre-commit run --all-files
142 changes: 142 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
name: release

permissions:
contents: write

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on:
pull_request:

push:
branches:
- "*"
tags:
- "*"

workflow_dispatch:

defaults:
run:
shell: bash

env:
name: row
CARGO_TERM_COLOR: always
CLICOLOR: 1
RUST_VERSION: 1.78.0

jobs:
source:
name: Build source tarball
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4.1.4
with:
path: code

- name: Determine filename-safe ref from GITHUB_REF_NAME
run: echo ref="$(echo "${GITHUB_REF_NAME}" | sed -e 's/\//-/g')" >> "$GITHUB_ENV"

- name: Copy source
run: cp -R code "${name}-${ref}"

- name: Remove .git
run: rm -rf "${name}-${ref}/.git" && ls -laR "${name}-${ref}"

- name: Tar/xz source
run: tar -cvJf "${name}-${ref}.tar.xz" "${name}-${ref}"

- uses: actions/upload-artifact@v4.3.3
with:
name: source
path: |
*.tar.*
release-notes:
name: Extract release notes
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4.1.4
with:
path: code

- name: Write release-notes.md
run: grep -P -m 2 -B 10000 "^## v*\d*\.\d*\.\d*" doc/src/release-notes.md | sed '$d' | tee "${GITHUB_WORKSPACE}/release-notes.md"
working-directory: code

- uses: actions/upload-artifact@v4.3.3
with:
name: release-notes
path: |
release-notes.md
binary:
name: Build [${{ matrix.target }}]
runs-on: ${{ matrix.runner }}
strategy:
matrix:
target:
- x86_64-unknown-linux-gnu
# - aarch64-apple-darwin
include:
- target: x86_64-unknown-linux-gnu
runner: ubuntu-20.04
# - target: aarch64-apple-darwin
# runner: macos-14

steps:
- uses: actions/checkout@v4.1.4
- name: Determine filename-safe ref from GITHUB_REF_NAME
run: echo ref="$(echo "${GITHUB_REF_NAME}" | sed -e 's/\//-/g')" >> "$GITHUB_ENV"
- name: Update rust
run: rustup install "$RUST_VERSION" --no-self-update && rustup default "$RUST_VERSION"
- name: Check rust installation
run: rustc -vV
- uses: actions/cache@v4.0.2
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-rust-${{ env.RUST_VERSION }}-cargo-release-binary-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
- name: Build
run: cargo build --locked --bin "${name}" --release --target ${{ matrix.target }}
- name: Check output
run: file "target/${{ matrix.target }}/release/${name}"
- name: Compress
run: cp "target/${{ matrix.target }}/release/${name}" . && tar -cvJf "${name}-${ref}-${{ matrix.target }}.tar.xz" "${name}"
- uses: actions/upload-artifact@v4.3.3
with:
name: ${{ matrix.target }}
path: "${{ env.name }}-${{ env.ref }}-${{ matrix.target }}.tar.xz"

publish:
name: Publish [GitHub]
needs: [binary, source, release-notes]
runs-on: ubuntu-latest

steps:
- name: Download artifacts
uses: actions/download-artifact@v4.1.7
with:
merge-multiple: true

- name: List files
run: ls -lR

- name: Create release
uses: softprops/action-gh-release@v2.0.5
if: startsWith(github.ref, 'refs/tags/v')
with:
files: |
*.xz
body_path: release-notes.md
make_latest: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading

0 comments on commit e5bde6c

Please sign in to comment.