Skip to content

Commit

Permalink
Merge pull request #2 from CloudCannon/fix/ci-golf-begins
Browse files Browse the repository at this point in the history
ci golf
  • Loading branch information
bglw authored Aug 16, 2024
2 parents ba5ed7c + db0789d commit 80f020f
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 29 deletions.
36 changes: 17 additions & 19 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ jobs:
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
default: true
components: rustfmt, clippy
toolchain: stable
override: true
default: true
components: rustfmt, clippy

- name: Get Version
run: echo GIT_VERSION="$(git describe --tags | sed 's/^v\(.*\)$/\1/')" >> $GITHUB_ENV
Expand All @@ -47,7 +47,7 @@ jobs:
git checkout -b deploy_branch
- name: Prepare Crates
run: |
# Update cargo version,
# Update cargo version,
node ./.backstage/version.cjs
git add ./toolproof/Cargo.toml
# Commit changes so cargo doesn't complain about dirty repo
Expand Down Expand Up @@ -156,7 +156,6 @@ jobs:
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}


publish-github-release:
name: Publish to GitHub
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -317,19 +316,19 @@ jobs:
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt update -y
sudo apt install -y musl-tools musl-dev clang gcc-aarch64-linux-gnu
sudo apt install -y musl-tools musl-dev clang gcc-aarch64-linux-gnu
echo "TARGET_CC=clang" >> $GITHUB_ENV
echo "CFLAGS_aarch64_unknown_linux_musl=--sysroot=/usr/aarch64-linux-gnu" >> $GITHUB_ENV
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=/usr/aarch64-linux-gnu/bin/ld" >> $GITHUB_ENV
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}
override: true
default: true
components: rustfmt, clippy
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}
override: true
default: true
components: rustfmt, clippy

- name: Prepare Git
run: |
Expand All @@ -340,7 +339,7 @@ jobs:
git checkout -b deploy_branch
- name: Prepare Crates
run: |
# Update cargo version,
# Update cargo version,
node ./.backstage/version.cjs
git add ./toolproof/Cargo.toml
# Commit changes so cargo doesn't complain about dirty repo
Expand All @@ -352,15 +351,15 @@ jobs:

- name: Test Lib
if: matrix.run_tests == true
working-directory: ./toolproof
working-directory: ./toolproof
run: cargo test --release --target ${{ matrix.target }}

- name: Test CLI
if: matrix.run_tests == true
working-directory: ./toolproof
# toolproof tests itself when run
run: cargo run -- --placeholders toolproof_path="$(pwd)/../target/debug/toolproof"
# toolproof tests itself when run
run: cargo run -- --placeholders toolproof_path="$(pwd)/../target/debug/toolproof" -c 1

# TODO: build and package pagebrowse
- name: Create Release Assets
run: |
Expand Down Expand Up @@ -408,4 +407,3 @@ jobs:
name: release-checksums
path: |
${{ env.CHECKSUM_PATH }}
23 changes: 13 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
run:
shell: bash
strategy:
fail-fast: false
matrix:
include:
- build: linux
Expand All @@ -40,26 +41,28 @@ jobs:
with:
fetch-depth: 1

- uses: Swatinem/rust-cache@v2

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}
override: true
default: true
components: rustfmt, clippy

- uses: Swatinem/rust-cache@v2
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}
override: true
default: true
components: rustfmt, clippy

- name: Build Lib
working-directory: ./toolproof
run: cargo build

- name: Test Lib
working-directory: ./toolproof
working-directory: ./toolproof
run: cargo test

- uses: browser-actions/setup-chrome@v1

- name: Test CLI
working-directory: ./toolproof
# toolproof tests itself when run
run: cargo run -- --placeholders toolproof_path="$(pwd)/../target/debug/toolproof"
# toolproof tests itself when run
run: cargo run -- --placeholders toolproof_path="$(pwd)/../target/debug/toolproof" -c 1

0 comments on commit 80f020f

Please sign in to comment.