Skip to content

Add strategy matrix for toolchain and different OSs with caching #54

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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
9 changes: 9 additions & 0 deletions .github/issue_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
### Description

<!-- Delete these comments later -->
<!-- Put the description of the task here -->

### Checklist

* [ ] Connect all related issues, and project boards, add labels, assign people, milestones etc.
* [ ] Make sure that this template is properly filled in and appropriate parts deleted
12 changes: 12 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
### Description

<!-- Delete these comments later -->
<!-- Put the description of the task here -->

### Checklist

<!-- Don't delete these, check them with a mouse if completed -->
* [ ] Add tests, documentation, update the changelog, etc.
* [ ] Connect all issues, and project boards, add labels, assign people to the PR and the issue, etc.
* [ ] Make sure that the PR description and title contain "Draft: " at the beginning if its not yet ready
* [ ] Make sure that this template is properly filled in and appropriate parts deleted
32 changes: 21 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build
name: 🔨 Build

on:
pull_request:
Expand All @@ -10,17 +10,27 @@ env:

jobs:
build:
name: 🔨Build release
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
toolchain: [stable, beta, nightly]
name: 🔨 Build release
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: 🔨Build release
- name: Install latest ${{ matrix.toolchain }}
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Build release
run: cargo build --release

package:
name: 📦Check package generation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: 📦Check package generation
run: cargo package
6 changes: 3 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Docs
name: 📄 Build docs

on:
pull_request:
Expand All @@ -10,9 +10,9 @@ env:

jobs:
docs:
name: 📄Build docs
name: 📄 Build docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: 📄Build docs
- name: Build docs
run: cargo doc --verbose
45 changes: 45 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: 👔 Check formatting

on:
pull_request:
push:
branches: ["main", "develop", "release"]

env:
CARGO_TERM_COLOR: always

jobs:
check_format:
name: 👔 Check formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: davidB/rust-cargo-make@v1
- name: Check Formatting
run: cargo make rust-fmt-check
check_format_markdown:
name: 🖋 Check markdown files
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Markdown Linting Action
uses: avto-dev/markdown-lint@v1.5.0
with:
args: "*.md"
check_format_toml:
name: 🪦 Check toml files
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: davidB/rust-cargo-make@v1
- run: cargo make toml-fmt-check
17 changes: 11 additions & 6 deletions .github/workflows/rust.yml → .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Code check

name: 🖋 Check linting

on:
pull_request:
Expand All @@ -9,15 +10,19 @@ env:
CARGO_TERM_COLOR: always

jobs:
code_check:
name: 👔✒️Formatting and Linting
check_lint:
name: 🖋 Check linting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: 👔Check Formatting
run: cargo fmt -- --verbose --check --color auto
- name: ✒️Check linting
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: davidB/rust-cargo-make@v1
- name: Check linting
run: |
rustup component add clippy
set env RUSTFLAGS="-Dwarnings"
cargo clippy --workspace -- -D warnings

42 changes: 12 additions & 30 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Package
name: 📦 Package

on:
pull_request:
Expand All @@ -9,46 +9,28 @@ env:
CARGO_TERM_COLOR: always

jobs:
# license:
# name: 🏫License check
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - name: 🏫Check license
# run: |
# cargo install cargo-deny
# cargo deny check

package:
name: 🔨Package
license:
name: 🏫License check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: 🔨Check package build
run: cargo package --verbose
- name: 🏫Check license
run: |
cargo install cargo-deny
cargo deny check

cargo_check:
name: 📦Check package integrity
name: 📦 Check package integrity
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: 📦Check package integrity
run: cargo check --verbose
- name: Check package integrity
run: cargo package --verbose

publish_dry_run:
name: 📢Publish dry-run
name: 📢 Publish dry-run
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: 📢Publish dry run
- name: Publish dry run
run: cargo publish --dry-run --verbose

# dummy_publish:
# name: 📦⬆️📢Publish dummy
# # needs: [license, package, cargo_check, publish_dry_run]
# needs: [package, cargo_check, publish_dry_run]
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - name: 📦⬆️📢Publish dry run
# run: cargo publish --dry-run --verbose
18 changes: 14 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Tests
name: 🧪 Tests

on:
pull_request:
Expand All @@ -10,9 +10,19 @@ env:

jobs:
test:
name: 🧪Run tests
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
toolchain: [stable, beta, nightly]
name: 🧪 Run tests
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: 🧪Run tests
- name: Install latest ${{ matrix.toolchain }}
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
- uses: actions/checkout@v2
- name: Run tests
run: cargo test --verbose

5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,7 @@ target/
workspace.code-workspace

# macOS
.DS_Store
.DS_Store

# Vim files
*.vim
1 change: 0 additions & 1 deletion .rustfmt.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
max_width = 88
ignore = ["."] # rustfmt does a poor job, and I don't want it ruining well-formatted code
40 changes: 34 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,27 @@

The branching strategy looks like this:

The short description of the branching strategy is as follows. The feature branches are a category of branches that branch out of the `develop` branch. A person branches out from develop, works on a given feature on their branch and when the feature is ready they submit a Pull Request to merge again into the develop branch. After the review process is finished the commits from the branch should be squashed and then merged into `develop` (GitHubs WebUI provides that). Therefore each commit that lands on the `develop` branch is an addition of a feature, documentation etc.. When an arbitrary set of new features is completed and could be deemed as a new release (release cycle should follow the [semver](https://semver.org/) convention) it should be merged into `main` (of course it should also follow the process of a Pull Request and reviews) when it is merged into `main` additional testing, validation etc. should be done as this is now a release candidate. If the state of the code is deemed safe and proper it should be released as a new version of the software. This should be done by tagging which marks a given commit a release candidate which should automatically trigger a series of CI/CD checks and if they succeed the software package will be finally released.
The short description of the branching strategy is as follows.
The feature branches are a category of branches that branch out
of the `develop` branch. A person branches out from develop,
works on a given feature on their branch and when the feature
is ready they submit a Pull Request to merge again into the
develop branch. After the review process is finished the commits
from the branch should be squashed and then merged into `develop`
(GitHubs WebUI provides that). Therefore each commit that lands
on the `develop` branch is an addition of a feature, documentation
etc.. When an arbitrary set of new features is completed and could
be deemed as a new release (release cycle should follow the
[semver](https://semver.org/) convention) it should be merged
into `main` (of course it should also follow the process of a
Pull Request and reviews) when it is merged into `main`
additional testing, validation etc. should be done as this is
now a release candidate. If the state of the code is deemed safe
and proper it should be released as a new version of the software.
This should be done by tagging which marks a given commit a
release candidate which should automatically trigger a series of
CI/CD checks and if they succeed the software package will
be finally released.

![branching](img/branching.png)

Expand All @@ -18,7 +38,8 @@ If you want to work on something create an issue for that.
1. Fill out the name for the issue
2. Provide a description for the task and what are your plans etc.
3. If you know you will be working on that task assign yourself
4. Add applicable labels to the task, e.g. if you are solving a bug then add `Bug`, if adding a new functionality add `Enhancement` etc.
4. Add applicable labels to the task, e.g. if you are solving a bug
then add `Bug`, if adding a new functionality add `Enhancement` etc.
5. Assign the task to the `rust-pip` project
6. If applicable assign the task to a given milestone
7. Submit the issue/task
Expand All @@ -27,7 +48,8 @@ If you want to work on something create an issue for that.

## Creating a branch and using it

Then when you have created an issue for you task click the `Create new branch` in the lower right corner:
Then when you have created an issue for you task click the `Create new branch`
in the lower right corner:

![cr](img/create_a_branch.png)

Expand All @@ -44,7 +66,9 @@ Now a branch has been created for you, copy the commands needed for you to use i

![asd](img/checkout.png)

In you cloned repository open a terminal and paste the copied commands. Now you should be on your newly created branch and you can start working. To make sure you are on that branch run:
In you cloned repository open a terminal and paste the copied commands.
Now you should be on your newly created branch and you can start working.
To make sure you are on that branch run:

```bash
$ git branch
Expand All @@ -53,11 +77,15 @@ $ git branch
```

The branch on which you currently reside will be marked with a `*`.
Next simply keep working on your branch, push commits, and when you think you are ready create a Pull Request, make sure that you mark your PR as a draft if its not ready for review otherwise it looks like noise.
Next simply keep working on your branch, push commits, and when you think
you are ready create a Pull Request, make sure that you mark your PR as a
draft if its not ready for review otherwise it looks like noise.

## Creating a Pull Request (PR)

After you create changes on your branch create a Pull Request and mark it as a `Draft` as that it can be seen that you are working on a given issue. Similarly to creating an issue ensure that:
After you create changes on your branch create a Pull Request and mark it
as a `Draft` as that it can be seen that you are working on a given issue.
Similarly to creating an issue ensure that:

* Summary of changes in the body of the pull
* Labels
Expand Down
1 change: 0 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

12 changes: 11 additions & 1 deletion Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ install_crate = "rustfmt"
command = "cargo"
args = ["fmt", "--", "--emit=files"]

[tasks.rust-fmt-check]
install_crate = "rustfmt"
command = "cargo"
args = ["fmt", "--", "--verbose", "--color", "auto"]

[tasks.toml-fmt-check]
install_crate = { crate_name = "taplo-cli", binary = "taplo", test_arg = "--help" }
command = "taplo"
args = ["fmt", "--check", "*.toml"]

[tasks.clean]
command = "cargo"
args = ["clean"]
Expand All @@ -28,4 +38,4 @@ dependencies = ["clean"]
[tasks.doc]
command = "cargo"
args = ["doc"]
dependencies = ["clean"]
dependencies = ["clean"]
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ Pip rewritten in Rust.

## How to contribute

Please read this file and follow its instructions when it comes to contributing ot the project:
Please read this file and follow its instructions when it comes to
contributing ot the project:

* [CONTRIBUTING.md](CONTRIBUTING.md)

Expand Down
Loading