Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
autarch committed Nov 5, 2023
0 parents commit 26df462
Show file tree
Hide file tree
Showing 14 changed files with 668 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/audit-nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Security audit - nightly

on:
schedule:
- cron: "0 0 * * *"

jobs:
security_audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rust-lang/audit@v1
16 changes: 16 additions & 0 deletions .github/workflows/audit-on-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Security audit - on push

on:
push:
paths:
- "**/Cargo.toml"
- "**/Cargo.lock"
tags-ignore:
- "precious-*"

jobs:
security_audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rust-lang/audit@v1
93 changes: 93 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: Tests and release

on:
push:
branches:
- "**"
tags-ignore:
- "precious-*"
pull_request:

env:
CRATE_NAME: precious
GITHUB_TOKEN: ${{ github.token }}
RUST_BACKTRACE: 1

jobs:
test:
name: ${{ matrix.platform.os_name }} with rust ${{ matrix.toolchain }}
runs-on: ${{ matrix.platform.os }}
strategy:
fail-fast: false
matrix:
platform:
- os_name: FreeBSD-x86_64
os: ubuntu-20.04
target: x86_64-unknown-freebsd
skip_tests: true
- os_name: Linux-x86_64
os: ubuntu-20.04
target: x86_64-unknown-linux-musl
- os_name: Linux-aarch64
os: ubuntu-20.04
target: aarch64-unknown-linux-musl
- os_name: Linux-arm
os: ubuntu-20.04
target: arm-unknown-linux-musleabi
- os_name: Linux-i686
os: ubuntu-20.04
target: i686-unknown-linux-musl
- os_name: Linux-powerpc
os: ubuntu-20.04
target: powerpc-unknown-linux-gnu
- os_name: Linux-powerpc64
os: ubuntu-20.04
target: powerpc64-unknown-linux-gnu
- os_name: Linux-powerpc64le
os: ubuntu-20.04
target: powerpc64le-unknown-linux-gnu
- os_name: Linux-riscv64
os: ubuntu-20.04
target: riscv64gc-unknown-linux-gnu
- os_name: Linux-s390x
os: ubuntu-20.04
target: s390x-unknown-linux-gnu
- os_name: NetBSD-x86_64
os: ubuntu-20.04
target: x86_64-unknown-netbsd
skip_tests: true
- os_name: Windows-aarch64
os: windows-latest
target: aarch64-pc-windows-msvc
skip_tests: true
- os_name: Windows-i686
os: windows-latest
target: i686-pc-windows-msvc
- os_name: Windows-x86_64
os: windows-latest
target: x86_64-pc-windows-msvc
- os_name: macOS-x86_64
os: macOS-latest
target: x86_64-apple-darwin
- os_name: macOS-aarch64
os: macOS-latest
target: aarch64-apple-darwin
skip_tests: true
toolchain:
- stable
- beta
- nightly
steps:
- uses: actions/checkout@v3
- name: Cache cargo & target directories
uses: Swatinem/rust-cache@v2
- name: Install musl-tools on Linux
run: sudo apt-get update --yes && sudo apt-get install --yes musl-tools
if: contains(matrix.platform.name, 'musl')
- name: Run tests
uses: houseabsolute/actions-rust-cross@v0
with:
command: "test"
target: ${{ matrix.platform.target }}
toolchain: ${{ matrix.toolchain }}
if: ${{ !matrix.platform.skip_tests }}
31 changes: 31 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Linting

on: [push, pull_request]

env:
CRATE_NAME: precious
GITHUB_TOKEN: ${{ github.token }}
RUST_BACKTRACE: 1

jobs:
lint:
name: Check that code is lint clean using precious
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Cache cargo & target directories
uses: Swatinem/rust-cache@v2
- name: Install toolchain
uses: dtolnay/rust-toolchain@stable
- name: Configure Git
run: |
git config --global user.email "jdoe@example.com"
git config --global user.name "J. Doe"
- name: Run install-dev-tools.sh
run: |
set -e
mkdir $HOME/bin
./dev/bin/install-dev-tools.sh
- name: Run precious
run: |
PATH=$PATH:$HOME/bin precious lint -a
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/Cargo.lock
/node_modules
/target
65 changes: 65 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers
pledge to making participation in our project and our community a harassment-free experience for
everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level
of experience, education, socio-economic status, nationality, personal appearance, race, religion,
or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:

- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

- The use of sexualized language or imagery and unwelcome sexual attention or advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic address, without explicit
permission
- Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are
expected to take appropriate and fair corrective action in response to any instances of unacceptable
behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits,
code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or
to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is
representing the project or its community. Examples of representing a project or community include
using an official project e-mail address, posting via an official social media account, or acting as
an appointed representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting
the project team at autarch@urth.org. All complaints will be reviewed and investigated and will
result in a response that is deemed necessary and appropriate to the circumstances. The project team
is obligated to maintain confidentiality with regard to the reporter of an incident. Further details
of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face
temporary or permanent repercussions as determined by other members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at
https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org
29 changes: 29 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[package]
name = "pushd"
version = "0.1.0"
authors = ["Dave Rolsky <autarch@urth.org>"]
description = "A library that implements pushd"
repository = "https://github.com/houseabsolute/pushd"
readme = "README.md"
license = "MIT OR Apache-2.0"
edition = "2021"

[dependencies]
log = "0.4.20"
serial_test = "2.0.0"
tempfile = "3.8.1"
thiserror = "1.0.50"

[package.metadata.release]
tag-name = "v{{version}}"

# workaround for https://github.com/cross-rs/cross/issues/1345
[package.metadata.cross.target.x86_64-unknown-netbsd]
pre-build = [
"mkdir -p /tmp/netbsd",
"curl https://cdn.netbsd.org/pub/NetBSD/NetBSD-9.2/amd64/binary/sets/base.tar.xz -O",
"tar -C /tmp/netbsd -xJf base.tar.xz",
"cp /tmp/netbsd/usr/lib/libexecinfo.so /usr/local/x86_64-unknown-netbsd/lib",
"rm base.tar.xz",
"rm -rf /tmp/netbsd",
]
Loading

0 comments on commit 26df462

Please sign in to comment.