Skip to content

Commit ca45d51

Browse files
authored
Merge pull request #116 from mkantor/format-yaml
Format GitHub Actions workflow YAML files.
2 parents 6912122 + de8df7f commit ca45d51

File tree

2 files changed

+86
-88
lines changed

2 files changed

+86
-88
lines changed

.github/workflows/release.yml

Lines changed: 48 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,16 @@ env:
99
CARGO_TERM_COLOR: always
1010

1111
jobs:
12-
1312
verify-version:
1413
runs-on: ubuntu-latest
1514
steps:
16-
- uses: actions/checkout@v2
17-
- run: |
18-
tag="${GITHUB_REF#refs/tags/}"
19-
package_version="$(cargo read-manifest | jq --raw-output .version)"
20-
echo "Git tag name: ${tag}"
21-
echo "Cargo.toml version: ${package_version}"
22-
test "$tag" == "$package_version"
15+
- uses: actions/checkout@v2
16+
- run: |
17+
tag="${GITHUB_REF#refs/tags/}"
18+
package_version="$(cargo read-manifest | jq --raw-output .version)"
19+
echo "Git tag name: ${tag}"
20+
echo "Cargo.toml version: ${package_version}"
21+
test "$tag" == "$package_version"
2322
2423
# Run the tests and create a fresh cache before releasing. Make sure that the
2524
# same code that was tested is what gets released.
@@ -28,18 +27,18 @@ jobs:
2827
strategy:
2928
matrix:
3029
os:
31-
- ubuntu-latest
32-
- macos-latest
30+
- ubuntu-latest
31+
- macos-latest
3332
steps:
34-
- uses: actions/checkout@v2
35-
- uses: actions/cache@v2
36-
with:
37-
path: |
38-
~/.cargo/registry
39-
~/.cargo/git
40-
target/release
41-
key: release-${{ runner.os }}-${{ github.job }}-${{ secrets.CI_CACHE_VERSION }}
42-
- run: cargo test --release
33+
- uses: actions/checkout@v2
34+
- uses: actions/cache@v2
35+
with:
36+
path: |
37+
~/.cargo/registry
38+
~/.cargo/git
39+
target/release
40+
key: release-${{ runner.os }}-${{ github.job }}-${{ secrets.CI_CACHE_VERSION }}
41+
- run: cargo test --release
4342

4443
publish-binary:
4544
needs:
@@ -49,8 +48,8 @@ jobs:
4948
strategy:
5049
matrix:
5150
os:
52-
- ubuntu-latest
53-
- macos-latest
51+
- ubuntu-latest
52+
- macos-latest
5453
include:
5554
- os: macos-latest
5655
artifact_prefix: macos-x86-64
@@ -59,34 +58,34 @@ jobs:
5958
artifact_prefix: linux-x86-64
6059
target: x86_64-unknown-linux-gnu
6160
steps:
62-
- uses: actions/checkout@v2
63-
- uses: actions/cache@v2
64-
with:
65-
path: |
66-
~/.cargo/registry
67-
~/.cargo/git
68-
target/release
69-
key: release-${{ runner.os }}-${{ github.job }}-${{ secrets.CI_CACHE_VERSION }}
70-
- run: rustup target add ${{ matrix.target }}
71-
- run: cargo build --release --target ${{ matrix.target }}
72-
- name: package binary
73-
shell: bash
74-
run: |
75-
cd target/${{ matrix.target }}/release
76-
strip ${{ github.event.repository.name }}
77-
tar czvf \
78-
${{ github.event.repository.name }}-${{ matrix.artifact_prefix }}.tar.gz \
79-
${{ github.event.repository.name }}
80-
shasum -a 256 ${{ github.event.repository.name }}-${{ matrix.artifact_prefix }}.tar.gz \
81-
> ${{ github.event.repository.name }}-${{ matrix.artifact_prefix }}.sha256
82-
- name: publish release to github
83-
uses: softprops/action-gh-release@v1
84-
with:
85-
files: |
86-
target/${{ matrix.target }}/release/${{ github.event.repository.name }}-${{ matrix.artifact_prefix }}.tar.gz
87-
target/${{ matrix.target }}/release/${{ github.event.repository.name }}-${{ matrix.artifact_prefix }}.sha256
88-
env:
89-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61+
- uses: actions/checkout@v2
62+
- uses: actions/cache@v2
63+
with:
64+
path: |
65+
~/.cargo/registry
66+
~/.cargo/git
67+
target/release
68+
key: release-${{ runner.os }}-${{ github.job }}-${{ secrets.CI_CACHE_VERSION }}
69+
- run: rustup target add ${{ matrix.target }}
70+
- run: cargo build --release --target ${{ matrix.target }}
71+
- name: package binary
72+
shell: bash
73+
run: |
74+
cd target/${{ matrix.target }}/release
75+
strip ${{ github.event.repository.name }}
76+
tar czvf \
77+
${{ github.event.repository.name }}-${{ matrix.artifact_prefix }}.tar.gz \
78+
${{ github.event.repository.name }}
79+
shasum -a 256 ${{ github.event.repository.name }}-${{ matrix.artifact_prefix }}.tar.gz \
80+
> ${{ github.event.repository.name }}-${{ matrix.artifact_prefix }}.sha256
81+
- name: publish release to github
82+
uses: softprops/action-gh-release@v1
83+
with:
84+
files: |
85+
target/${{ matrix.target }}/release/${{ github.event.repository.name }}-${{ matrix.artifact_prefix }}.tar.gz
86+
target/${{ matrix.target }}/release/${{ github.event.repository.name }}-${{ matrix.artifact_prefix }}.sha256
87+
env:
88+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9089

9190
publish-crate:
9291
needs:

.github/workflows/validate-commit.yml

Lines changed: 38 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -10,60 +10,59 @@ env:
1010
CARGO_TERM_COLOR: always
1111

1212
jobs:
13-
1413
test:
1514
runs-on: ${{ matrix.os }}
1615
strategy:
1716
matrix:
1817
os:
19-
- ubuntu-latest
20-
- macos-latest
18+
- ubuntu-latest
19+
- macos-latest
2120
steps:
22-
- uses: actions/checkout@v2
23-
- uses: actions/cache@v2
24-
with:
25-
path: |
26-
~/.cargo/registry
27-
~/.cargo/git
28-
target/debug
29-
key: test-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}-${{ secrets.CI_CACHE_VERSION }}
30-
- run: cargo test
31-
# There is a bug with BSD tar on macOS where the first 8MB of the file are
32-
# sometimes all NUL bytes. See https://github.com/actions/cache/issues/403
33-
# and https://github.com/rust-lang/cargo/issues/8603 for some more
34-
# information. An alternative solution here is to install GNU tar, but
35-
# flushing the disk cache seems to work, too.
36-
- run: sudo purge
37-
if: startsWith(matrix.os, 'macos-')
21+
- uses: actions/checkout@v2
22+
- uses: actions/cache@v2
23+
with:
24+
path: |
25+
~/.cargo/registry
26+
~/.cargo/git
27+
target/debug
28+
key: test-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}-${{ secrets.CI_CACHE_VERSION }}
29+
- run: cargo test
30+
# There is a bug with BSD tar on macOS where the first 8MB of the file are
31+
# sometimes all NUL bytes. See https://github.com/actions/cache/issues/403
32+
# and https://github.com/rust-lang/cargo/issues/8603 for some more
33+
# information. An alternative solution here is to install GNU tar, but
34+
# flushing the disk cache seems to work, too.
35+
- run: sudo purge
36+
if: startsWith(matrix.os, 'macos-')
3837

3938
lint:
4039
runs-on: ubuntu-latest
4140
steps:
42-
- uses: actions/checkout@v2
43-
- uses: actions/cache@v2
44-
with:
45-
path: |
46-
~/.cargo/registry
47-
~/.cargo/git
48-
target/debug
49-
key: lint-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}-${{ secrets.CI_CACHE_VERSION }}
50-
- run: cargo clippy -- -D warnings
41+
- uses: actions/checkout@v2
42+
- uses: actions/cache@v2
43+
with:
44+
path: |
45+
~/.cargo/registry
46+
~/.cargo/git
47+
target/debug
48+
key: lint-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}-${{ secrets.CI_CACHE_VERSION }}
49+
- run: cargo clippy -- -D warnings
5150

5251
format:
5352
runs-on: ubuntu-latest
5453
steps:
55-
- uses: actions/checkout@v2
56-
- run: cargo fmt --all -- --check
54+
- uses: actions/checkout@v2
55+
- run: cargo fmt --all -- --check
5756

5857
benchmark:
5958
runs-on: ubuntu-latest
6059
steps:
61-
- uses: actions/checkout@v2
62-
- uses: actions/cache@v2
63-
with:
64-
path: |
65-
~/.cargo/registry
66-
~/.cargo/git
67-
target/release
68-
key: benchmark-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}-${{ secrets.CI_CACHE_VERSION }}
69-
- run: cargo bench
60+
- uses: actions/checkout@v2
61+
- uses: actions/cache@v2
62+
with:
63+
path: |
64+
~/.cargo/registry
65+
~/.cargo/git
66+
target/release
67+
key: benchmark-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}-${{ secrets.CI_CACHE_VERSION }}
68+
- run: cargo bench

0 commit comments

Comments
 (0)