Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
* upstream/main: (26 commits)
  link on summary the documentation on how to fix the mutants' output
  mutants: add link to summary on failed output job cases
  documentation how mutants output should be treated
  fix: run one test at a time
  fix(rustfmt): Exit script with error code on failure
  fix(rustfmt): Read `rustfmt` alias from `.cargo/config` or `.cargo/config.toml`
  feat: remove `./`
  feat: check if release dir exists before trying to access it
  feat: setup rustfmt in composite actions
  feat: get rid of the `release/` path in the generated checksums
  fix: remove leftover git diff file
  feat: upload and download artifacts under different names
  feat: update all actions versions used
  more whitepsace removal
  remove whitespace
  remove portable build flag
  remove portable stacks-network/stacks-core#4646
  change to check for unviable from inexistent file to empty file
  remove conditional build
  build all binaries and copy them with find where possible (macos arm64 is outlier)
  ...
  • Loading branch information
wileyj committed Jul 10, 2024
2 parents e92e068 + e958871 commit e45b4e8
Show file tree
Hide file tree
Showing 30 changed files with 240 additions and 124 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ jobs:
## Setup docker buildx
- name: Set up Docker Buildx
id: docker_buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0
```
Which uses [this commit](https://github.com/docker/setup-buildx-action/commit/f95db51fddba0c2d1ec667646a06c2ce06100226)
Expand Down
4 changes: 2 additions & 2 deletions codecov/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ runs:
## - use wretry action, to retry on a failed upload
- name: Upload Code Coverage
id: code_coverage
uses: Wandalen/wretry.action@4ca71ac27896a6670a57267cf3ddec528278c86f # v2.0.0
uses: Wandalen/wretry.action@6feedb7dedadeb826de0f45ff482b53b379a7844 # v3.5.0
with:
action: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
action: codecov/codecov-action@5ecb98a3c6b747ed38dc09f787459979aebb39be # v4.3.1
with: |
files: ${{ inputs.filename }}
name: ${{ inputs.test-name }}
Expand Down
6 changes: 3 additions & 3 deletions docker/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ runs:
## Checkout the code
- name: Checkout the latest code
id: git_checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5

## Set some vars to be used in the build process
- name: Set Vars
Expand Down Expand Up @@ -56,15 +56,15 @@ runs:
## Setup docker buildx
- name: Set up Docker Buildx
id: docker_buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0

## Login to dockerhub
- name: Login to DockerHub
if: |
inputs.username != '' &&
inputs.password != ''
id: docker_login
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1.0
with:
username: ${{ inputs.username }}
password: ${{ inputs.password }}
12 changes: 8 additions & 4 deletions generate-checksum/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ Generates a 512-bit `sha` hash for each file downloaded from artifacts.

### Inputs

| Input | Description | Required | Default |
| --------------- | --------------------------------------- | -------- | --------------- |
| `hashfile_name` | The name of the generated checksum file | false | "CHECKSUMS.txt" |
| Input | Description | Required | Default |
| --------------------------- | --------------------------------------------------------------------- | ----- | --------------- |
| `hashfile_name` | The name of the generated checksum file | false | "CHECKSUMS.txt" |
| `artifact_download_pattern` | The pattern of artifacts to download. Defaults to '*' (all artifacts) | false | "*" |

## Usage

Expand All @@ -22,5 +23,8 @@ jobs:
steps:
- name: Generate Checksum
id: generate_checksum
uses: wileyj/actions/generate-checksum@main
uses: stacks-network/actions/generate-checksum@main
with:
hashfile_name: "hashes.txt"
artifact_download_pattern: "binary-build-*"
```
20 changes: 16 additions & 4 deletions generate-checksum/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,22 @@ inputs:
description: "The name of the generated checksum file"
required: false
default: "CHECKSUMS.txt"
artifact_download_pattern:
description: "The pattern of artifacts to download. Defaults to '*' (all artifacts)"
required: false
default: "*"

runs:
using: "composite"
steps:
## Downloads the artifacts built in `create-source-binary.yml`
- name: Download Artifacts
id: download_artifacts
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: artifact
pattern: ${{ inputs.artifact_download_pattern }}
path: release
merge-multiple: true

## Generate a checksums file to be added to the release page
- name: Generate Checksums
Expand All @@ -30,13 +35,20 @@ runs:
fi
# Generate the hashes and exit if the variable is empty
shasum="$(sha512sum release/*)"
if [ -d release ]; then
cd release
else
echo "Artifact directory does not exist!"
exit 1;
fi
shasum="$(sha512sum *)"
if [[ -z "$shasum" ]]; then
echo "Checksum could not be generated!";
exit 1;
fi
echo "Generated checksums:"
echo "$shasum"
echo "$shasum" > "${{ inputs.hashfile_name }}";
echo "$shasum" > "../${{ inputs.hashfile_name }}";
exit 0;
4 changes: 2 additions & 2 deletions openapi/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ runs:
## checkout the code
- name: Checkout the latest code
id: git_checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5

## Use redoc to generate HTML of openapi.yml
- name: Redoc
Expand All @@ -39,7 +39,7 @@ runs:
## Upload the html file artifact
- name: Upload bundled html
id: upload_html_artifact
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: open-api-bundle
path: |
Expand Down
12 changes: 6 additions & 6 deletions rustfmt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ All inputs are optional.
If a [toolchain file](https://rust-lang.github.io/rustup/overrides.html#the-toolchain-file) (i.e., `rust-toolchain` or `rust-toolchain.toml`) is found in the root of the repository, it takes precedence.
All input values are ignored if a toolchain file exists.

| Name | Description | Default |
| --------------- | ------------------------------------------------------------------------ | -------------- |
| `manifest-path` | Path to the `Cargo.toml` file, by default in the root of the repository. | `./Cargo.toml` |
| `alias` | The alias for cargo fmt (set in `.cargo/config`) | `fmt` |
| Name | Description | Default |
| --------------- | -------------------------------------------------------------------------- | -------------- |
| `manifest-path` | Path to the `Cargo.toml` file, by default in the root of the repository. | `./Cargo.toml` |
| `alias` | The alias for `cargo fmt` (set in `.cargo/config` or `.cargo/config.toml`) | `fmt` |

[`actions-rust-lang/setup-rust-toolchain`]: https://github.com/actions-rust-lang/setup-rust-toolchain
[problem matcher]: https://github.com/actions/toolkit/blob/main/docs/problem-matchers.md
Expand All @@ -32,10 +32,10 @@ jobs:
name: cargo fmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5

# Ensure rustfmt is installed and setup problem matcher
- uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: actions-rust-lang/setup-rust-toolchain@b113a30d27a8e59c969077c0a0168cc13dab5ffc # v1.8.0
with:
components: rustfmt

Expand Down
30 changes: 28 additions & 2 deletions rustfmt/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,36 @@ inputs:
runs:
using: composite
steps:
- name: Checkout the latest code
id: git_checkout
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5

- name: Setup Rust Toolchain
id: setup_rust_toolchain
uses: actions-rust-lang/setup-rust-toolchain@b113a30d27a8e59c969077c0a0168cc13dab5ffc # v1.8.0
with:
components: rustfmt
cache: false

- name: Rustfmt Job Summary
shell: bash
run: |
# Find Cargo config file
declare -a config_file_locations=(".cargo/config.toml" ".cargo/config")
config_file=""
for file in "${config_file_locations[@]}"; do
if [ -f "$file" ]; then
config_file="$file"
break
fi
done
if [ -z "$config_file" ]; then
echo "No config file found!";
exit 1;
fi
# Split alias command's options
alias=$(grep -e "${{ inputs.alias }}.*=" .cargo/config | tr -d '"' | awk '/^${{ inputs.alias }}[[:space:]]*=/ {sub(/^${{ inputs.alias }}[[:space:]]*=[[:space:]]*/, ""); print; exit}')
alias=$(grep -e "${{ inputs.alias }}.*=" "$config_file" | tr -d '"' | awk '/^${{ inputs.alias }}[[:space:]]*=/ {sub(/^${{ inputs.alias }}[[:space:]]*=[[:space:]]*/, ""); print; exit}')
before_empty_dashes=""
after_empty_dashes=""
Expand All @@ -35,6 +60,7 @@ runs:
if [[ "${args[0]}" != "fmt" && "${{ inputs.alias }}" != "fmt" ]]; then
echo "The provided alias is invalid!";
exit 1;
fi
for arg in "${args[@]}"; do
Expand Down Expand Up @@ -85,4 +111,4 @@ runs:
# Print the original cargo message
echo "${CARGO_OUTPUT}"
# Exit with the same status as cargo
exit "${CARGO_STATUS}"
exit "${CARGO_STATUS}"
10 changes: 5 additions & 5 deletions stacks-core/cache/bitcoin/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ runs:
if: |
inputs.action == 'check' ||
inputs.action == 'save'
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
id: check_cache
with:
lookup-only: true
Expand All @@ -56,9 +56,9 @@ runs:
if: |
inputs.action == 'restore'
id: restore_cache
uses: Wandalen/wretry.action@4ca71ac27896a6670a57267cf3ddec528278c86f # v2.0.0
uses: Wandalen/wretry.action@6feedb7dedadeb826de0f45ff482b53b379a7844 # v3.5.0
with:
action: actions/cache/restore@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
action: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with: |
fail-on-cache-miss: ${{ inputs.fail-on-cache-miss }}
path: ~/bitcoin
Expand All @@ -84,9 +84,9 @@ runs:
inputs.action == 'save' &&
steps.check_cache.outputs.cache-hit != 'true'
id: save_cache
uses: Wandalen/wretry.action@4ca71ac27896a6670a57267cf3ddec528278c86f # v2.0.0
uses: Wandalen/wretry.action@6feedb7dedadeb826de0f45ff482b53b379a7844 # v3.5.0
with:
action: actions/cache/save@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
action: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with: |
path: ~/bitcoin
key: ${{ inputs.cache-key }}-${{ inputs.btc-version }}
Expand Down
4 changes: 2 additions & 2 deletions stacks-core/cache/build-cache/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ runs:
steps.check_test_archive_cache.outputs.cache-hit != 'true' ||
steps.check_genesis_test_archive_cache.outputs.cache-hit != 'true'
id: git_checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5

- name: Setup Rust Toolchain
if: |
steps.check_target_cache.outputs.cache-hit != 'true' ||
steps.check_test_archive_cache.outputs.cache-hit != 'true' ||
steps.check_genesis_test_archive_cache.outputs.cache-hit != 'true'
id: setup_rust_toolchain
uses: actions-rust-lang/setup-rust-toolchain@f3c84ee10bf5a86e7a5d607d487bf17d57670965 # v1.5.0
uses: actions-rust-lang/setup-rust-toolchain@b113a30d27a8e59c969077c0a0168cc13dab5ffc # v1.8.0
with:
toolchain: stable
components: llvm-tools-preview
Expand Down
14 changes: 7 additions & 7 deletions stacks-core/cache/cargo/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ runs:
if: |
inputs.action == 'check' ||
inputs.action == 'save'
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
id: check_cache
with:
lookup-only: true
Expand All @@ -57,9 +57,9 @@ runs:
if: |
inputs.action == 'restore'
id: restore_cache
uses: Wandalen/wretry.action@4ca71ac27896a6670a57267cf3ddec528278c86f # v2.0.0
uses: Wandalen/wretry.action@6feedb7dedadeb826de0f45ff482b53b379a7844 # v3.5.0
with:
action: actions/cache/restore@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
action: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with: |
fail-on-cache-miss: ${{ inputs.fail-on-cache-miss }}
path: |
Expand All @@ -78,7 +78,7 @@ runs:
inputs.action == 'save' &&
steps.check_cache.outputs.cache-hit != 'true'
id: install_nextest
uses: taiki-e/install-action@ac89944b5b150d78567ab6c02badfbe48b0b55aa # v2.20.16
uses: taiki-e/install-action@2f990e9c484f0590cb76a07296e9677b417493e9 # v2.33.23
with:
tool: nextest # can be versioned, ex: [email protected]

Expand All @@ -89,7 +89,7 @@ runs:
inputs.action == 'save' &&
steps.check_cache.outputs.cache-hit != 'true'
id: install_grcov
uses: taiki-e/install-action@ac89944b5b150d78567ab6c02badfbe48b0b55aa # v2.20.16
uses: taiki-e/install-action@2f990e9c484f0590cb76a07296e9677b417493e9 # v2.33.23
with:
tool: grcov # can be versioned, ex: [email protected]

Expand All @@ -99,9 +99,9 @@ runs:
inputs.action == 'save' &&
steps.check_cache.outputs.cache-hit != 'true'
id: save_cache
uses: Wandalen/wretry.action@4ca71ac27896a6670a57267cf3ddec528278c86f # v2.0.0
uses: Wandalen/wretry.action@6feedb7dedadeb826de0f45ff482b53b379a7844 # v3.5.0
with:
action: actions/cache/save@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
action: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with: |
path: |
~/.cargo/bin/
Expand Down
10 changes: 5 additions & 5 deletions stacks-core/cache/genesis-test-archive/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ runs:
if: |
inputs.action == 'check' ||
inputs.action == 'save'
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
id: check_cache
with:
lookup-only: true
Expand All @@ -53,9 +53,9 @@ runs:
if: |
inputs.action == 'restore'
id: restore_cache
uses: Wandalen/wretry.action@4ca71ac27896a6670a57267cf3ddec528278c86f # v2.0.0
uses: Wandalen/wretry.action@6feedb7dedadeb826de0f45ff482b53b379a7844 # v3.5.0
with:
action: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
action: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with: |
fail-on-cache-miss: ${{ inputs.fail-on-cache-miss }}
path: ~/genesis_archive.tar.zst
Expand All @@ -70,9 +70,9 @@ runs:
inputs.action == 'save' &&
steps.check_cache.outputs.cache-hit != 'true'
id: save_cache
uses: Wandalen/wretry.action@4ca71ac27896a6670a57267cf3ddec528278c86f # v2.0.0
uses: Wandalen/wretry.action@6feedb7dedadeb826de0f45ff482b53b379a7844 # v3.5.0
with:
action: actions/cache/save@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
action: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with: |
path: ~/genesis_archive.tar.zst
key: ${{ inputs.cache-key }}
Expand Down
10 changes: 5 additions & 5 deletions stacks-core/cache/target/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ runs:
- name: Check Cache
if: |
inputs.action == 'check'
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
id: check_cache
with:
lookup-only: true
Expand All @@ -52,9 +52,9 @@ runs:
if: |
inputs.action == 'restore'
id: restore_cache
uses: Wandalen/wretry.action@4ca71ac27896a6670a57267cf3ddec528278c86f # v2.0.0
uses: Wandalen/wretry.action@6feedb7dedadeb826de0f45ff482b53b379a7844 # v3.5.0
with:
action: actions/cache/restore@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
action: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with: |
fail-on-cache-miss: ${{ inputs.fail-on-cache-miss }}
path: ./target
Expand All @@ -68,9 +68,9 @@ runs:
if: |
inputs.action == 'save'
id: save_cache
uses: Wandalen/wretry.action@4ca71ac27896a6670a57267cf3ddec528278c86f # v2.0.0
uses: Wandalen/wretry.action@6feedb7dedadeb826de0f45ff482b53b379a7844 # v3.5.0
with:
action: actions/cache/save@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
action: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with: |
path: ./target
key: ${{ inputs.cache-key }}
Expand Down
Loading

0 comments on commit e45b4e8

Please sign in to comment.