Skip to content

Commit

Permalink
Update GH actions using deprecated runtimes (#267)
Browse files Browse the repository at this point in the history
  • Loading branch information
sourcefrog authored Jan 26, 2024
2 parents 9e6d7ec + 06d48a3 commit 4b8b6e1
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 40 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/book.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install mdbook and mdbook-linkcheck
uses: taiki-e/install-action@v2
with:
Expand All @@ -24,7 +24,7 @@ jobs:
run: |
mdbook build book
- name: Archive book output
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: always()
with:
name: book
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-book.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
cancel-in-progress: true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install mdbook
Expand Down
47 changes: 34 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ permissions:
on:
push:
tags:
- '**[0-9]+.[0-9]+.[0-9]+*'
- "**[0-9]+.[0-9]+.[0-9]+*"
pull_request:

jobs:
Expand All @@ -50,7 +50,9 @@ jobs:
outputs:
val: ${{ steps.plan.outputs.manifest }}
tag: ${{ !github.event.pull_request && github.ref_name || '' }}
tag-flag: ${{ !github.event.pull_request && format('--tag={0}', github.ref_name) || '' }}
tag-flag:
${{ !github.event.pull_request && format('--tag={0}', github.ref_name)
|| '' }}
publishing: ${{ !github.event.pull_request }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -62,7 +64,10 @@ jobs:
# we specify bash to get pipefail; it guards against the `curl` command
# failing. otherwise `sh` won't catch that `curl` returned non-0
shell: bash
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.7.1/cargo-dist-installer.sh | sh"
run:
"curl --proto '=https' --tlsv1.2 -LsSf
https://github.com/axodotdev/cargo-dist/releases/download/v0.8.0/cargo-dist-installer.sh
| sh"
# sure would be cool if github gave us proper conditionals...
# so here's a doubly-nested ternary-via-truthiness to try to provide the best possible
# functionality based on whether this is a pull_request, and whether it's from a fork.
Expand All @@ -86,7 +91,10 @@ jobs:
# Let the initial task tell us to not run (currently very blunt)
needs:
- plan
if: ${{ fromJson(needs.plan.outputs.val).ci.github.artifacts_matrix.include != null && (needs.plan.outputs.publishing == 'true' || fromJson(needs.plan.outputs.val).ci.github.pr_run_mode == 'upload') }}
if:
${{ fromJson(needs.plan.outputs.val).ci.github.artifacts_matrix.include !=
null && (needs.plan.outputs.publishing == 'true' ||
fromJson(needs.plan.outputs.val).ci.github.pr_run_mode == 'upload') }}
strategy:
fail-fast: false
# Target platforms/runners are computed by cargo-dist in create-release.
Expand All @@ -103,7 +111,8 @@ jobs:
runs-on: ${{ matrix.runner }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BUILD_MANIFEST_NAME: target/distrib/${{ join(matrix.targets, '-') }}-dist-manifest.json
BUILD_MANIFEST_NAME:
target/distrib/${{ join(matrix.targets, '-') }}-dist-manifest.json
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -113,7 +122,7 @@ jobs:
run: ${{ matrix.install_dist }}
# Get the dist-manifest
- name: Fetch local artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: artifacts
path: target/distrib/
Expand Down Expand Up @@ -160,10 +169,13 @@ jobs:
with:
submodules: recursive
- name: Install cargo-dist
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.7.1/cargo-dist-installer.sh | sh"
run:
"curl --proto '=https' --tlsv1.2 -LsSf
https://github.com/axodotdev/cargo-dist/releases/download/v0.8.0/cargo-dist-installer.sh
| sh"
# Get all the local artifacts for the global tasks to use (for e.g. checksums)
- name: Fetch local artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: artifacts
path: target/distrib/
Expand Down Expand Up @@ -193,7 +205,12 @@ jobs:
- build-local-artifacts
- build-global-artifacts
# Only run if we're "publishing", and only if local and global didn't fail (skipped is fine)
if: ${{ always() && needs.plan.outputs.publishing == 'true' && (needs.build-global-artifacts.result == 'skipped' || needs.build-global-artifacts.result == 'success') && (needs.build-local-artifacts.result == 'skipped' || needs.build-local-artifacts.result == 'success') }}
if:
${{ always() && needs.plan.outputs.publishing == 'true' &&
(needs.build-global-artifacts.result == 'skipped' ||
needs.build-global-artifacts.result == 'success') &&
(needs.build-local-artifacts.result == 'skipped' ||
needs.build-local-artifacts.result == 'success') }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
runs-on: "ubuntu-20.04"
Expand All @@ -204,10 +221,13 @@ jobs:
with:
submodules: recursive
- name: Install cargo-dist
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.7.1/cargo-dist-installer.sh | sh"
run:
"curl --proto '=https' --tlsv1.2 -LsSf
https://github.com/axodotdev/cargo-dist/releases/download/v0.8.0/cargo-dist-installer.sh
| sh"
# Fetch artifacts from scratch-storage
- name: Fetch artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: artifacts
path: target/distrib/
Expand Down Expand Up @@ -242,7 +262,7 @@ jobs:
with:
submodules: recursive
- name: "Download Github Artifacts"
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: artifacts
path: artifacts
Expand All @@ -256,5 +276,6 @@ jobs:
tag: ${{ needs.plan.outputs.tag }}
name: ${{ fromJson(needs.host.outputs.val).announcement_title }}
body: ${{ fromJson(needs.host.outputs.val).announcement_github_body }}
prerelease: ${{ fromJson(needs.host.outputs.val).announcement_is_prerelease }}
prerelease:
${{ fromJson(needs.host.outputs.val).announcement_is_prerelease }}
artifacts: "artifacts/*"
24 changes: 12 additions & 12 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- main
pull_request:
paths:
- ".cargo/**"
- ".cargo/*.toml"
- ".github/workflows/tests.yml"
- "Cargo.*"
- "mutants_attrs/**"
Expand Down Expand Up @@ -38,7 +38,7 @@ jobs:
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.version }}
Expand All @@ -62,7 +62,7 @@ jobs:
release-binary:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: dtolnay/rust-toolchain@master
Expand All @@ -72,7 +72,7 @@ jobs:
- name: Build
run: cargo build --release
- name: Upload binary artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: cargo-mutants-linux
path: |
Expand All @@ -86,7 +86,7 @@ jobs:
matrix:
test_tool: [cargo, nextest]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Relative diff
Expand All @@ -102,7 +102,7 @@ jobs:
with:
tool: nextest
- name: Download cargo-mutants binary
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: cargo-mutants-linux
- name: Install cargo-mutants binary
Expand All @@ -114,10 +114,10 @@ jobs:
cargo mutants --no-shuffle -vV --in-diff git.diff --test-tool
${{matrix.test_tool}}
- name: Archive mutants.out
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: always()
with:
name: mutants-incremental.out
name: mutants-incremental-${{ matrix.test_tool}}.out
path: mutants.out

cargo-mutants:
Expand All @@ -128,7 +128,7 @@ jobs:
shard: [0, 1, 2, 3, 4, 5, 6, 7]
test_tool: [cargo]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: beta
Expand All @@ -138,7 +138,7 @@ jobs:
with:
tool: nextest
- name: Download cargo-mutants binary
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: cargo-mutants-linux
- name: Install cargo-mutants binary
Expand All @@ -151,8 +151,8 @@ jobs:
--test-tool ${{ matrix.test_tool }} --baseline=skip --timeout=240
--in-place
- name: Archive mutants.out
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: always()
with:
name: mutants.out
name: mutants-${{matrix.test_tool}}-shard${{matrix.shard}}.out
path: mutants.out
11 changes: 4 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -144,18 +144,15 @@ exclude = [
# Config for 'cargo dist'
[workspace.metadata.dist]
# The preferred cargo-dist version to use in CI (Cargo.toml SemVer syntax)
cargo-dist-version = "0.7.1"
cargo-dist-version = "0.8.0"
# CI backends to support
ci = ["github"]
# The installers to generate for each app
installers = ["shell", "powershell"]
# Target platforms to build apps for (Rust target-triple syntax)
targets = [
"x86_64-unknown-linux-gnu",
"aarch64-apple-darwin",
"x86_64-apple-darwin",
"x86_64-pc-windows-msvc",
]
targets = ["aarch64-apple-darwin", "x86_64-apple-darwin", "x86_64-unknown-linux-gnu", "x86_64-pc-windows-msvc"]
# Publish jobs to run in CI
pr-run-mode = "plan"
# # Publish jobs to run in CI
# pr-run-mode = "upload"

Expand Down
2 changes: 1 addition & 1 deletion book/src/ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
- name: Run mutant tests
run: cargo mutants -vV --in-place
- name: Archive results
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: always()
with:
name: mutants-out
Expand Down
4 changes: 2 additions & 2 deletions book/src/pr-diff.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Relative diff
Expand All @@ -40,7 +40,7 @@ jobs:
run: |
cargo mutants --no-shuffle -j 2 -vV --in-diff git.diff
- name: Archive mutants.out
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: always()
with:
name: mutants-incremental.out
Expand Down
4 changes: 2 additions & 2 deletions book/src/shards.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ For example, in GitHub Actions, you could use a matrix job to run multiple shard
matrix:
shard: [0, 1, 2, 3, 4, 5, 6, 7]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: beta
Expand All @@ -39,7 +39,7 @@ For example, in GitHub Actions, you could use a matrix job to run multiple shard
run: |
cargo mutants --no-shuffle -vV --shard ${{ matrix.shard }}/8
- name: Archive mutants.out
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: always()
with:
name: mutants.out
Expand Down

0 comments on commit 4b8b6e1

Please sign in to comment.