Skip to content
Open
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
46 changes: 28 additions & 18 deletions .github/workflows/gnostr-bot-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,27 +69,30 @@ jobs:
access_token: ${{ github.token }}

- name: Restore rustup
if: ${{ steps.time_check_second.outputs.is_even == 'true' }}
id: cache-rustup-restore
uses: actions/cache/restore@v3
if: ${{ !env.ACT }}
#if: ${{ !env.ACT }}
with:
path: |
~/.rustup
key: ${{ runner.os }}-rustup-${{ matrix.rustup }}

- name: Restore cargo
if: ${{ steps.time_check_second.outputs.is_even == 'true' }}
id: cache-cargo-restore
uses: actions/cache/restore@v3
if: ${{ !env.ACT }}
#if: ${{ !env.ACT }}
with:
path: |
~/.cargo
key: ${{ runner.os }}-cargo-${{ matrix.rustup }}

- name: Restore target
if: ${{ steps.time_check_second.outputs.is_even == 'true' }}
id: cache-target-restore
uses: actions/cache/restore@v3
if: ${{ !env.ACT }}
#if: ${{ !env.ACT }}
with:
path: |
target
Expand All @@ -112,27 +115,31 @@ jobs:

- run: cargo-binstall --no-confirm gnostr

- run: /bin/bash -c "sudo apt-get install build-essential procps curl file git"
if: matrix.os == 'ubuntu-latest'
#- run: /bin/bash -c "sudo apt-get install build-essential procps curl file git"
# if: matrix.os == 'ubuntu-latest'

- run: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
if: matrix.os != 'windows-latest'
if: matrix.os == 'macos-latest'
#if: matrix.os != 'windows-latest'

- run: |
test -d ~/.linuxbrew && eval "$(~/.linuxbrew/bin/brew shellenv)"
test -d /home/linuxbrew/.linuxbrew && eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
echo "eval \"\$($(brew --prefix)/bin/brew shellenv)\"" >> ~/.bashrc
brew install gnostr-org/gnostr-org/gnostr && gnostr --help
if: matrix.os == 'ubuntu-latest'
#- run: |
# test -d ~/.linuxbrew && eval "$(~/.linuxbrew/bin/brew shellenv)"
# test -d /home/linuxbrew/.linuxbrew && eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
# echo "eval \"\$($(brew --prefix)/bin/brew shellenv)\"" >> ~/.bashrc
# brew install gnostr-org/gnostr-org/gnostr && gnostr --help
# if: matrix.os == 'ubuntu-latest'

- run: brew tap gnostr-org/homebrew-gnostr-org || true
if: matrix.os != 'windows-latest'
if: matrix.os == 'macos-latest'
#if: matrix.os != 'windows-latest'

- run: brew tap nostorg/nostr || true
if: matrix.os != 'windows-latest'
if: matrix.os == 'macos-latest'
#if: matrix.os != 'windows-latest'

- run: brew tap randymcmillan/homebrew-randymcmillan || true
if: matrix.os != 'windows-latest'
if: matrix.os == 'macos-latest'
#if: matrix.os != 'windows-latest'

- run: brew install gnostr-org/gnostr-org/gnostr && gnostr --help
if: matrix.os == 'macos-latest'
Expand Down Expand Up @@ -335,25 +342,28 @@ jobs:
echo "http://nostr.band/$NOTE"

- name: Save rustup
if: ${{ steps.time_check_second.outputs.is_even == 'true' }}
id: cache-rustup-save
uses: actions/cache/save@v3
if: ${{ !env.ACT }}
#if: ${{ !env.ACT }}
with:
path: |
~/.rustup
key: ${{ steps.cache-rustup-restore.outputs.cache-primary-key }}
- name: Save cargo
if: ${{ steps.time_check_second.outputs.is_even == 'true' }}
id: cache-cargo-save
uses: actions/cache/save@v3
if: ${{ !env.ACT }}
#if: ${{ !env.ACT }}
with:
path: |
~/.cargo
key: ${{ steps.cache-cargo-restore.outputs.cache-primary-key }}
- name: Save target
if: ${{ steps.time_check_second.outputs.is_even == 'true' }}
id: cache-target-save
uses: actions/cache/save@v3
if: ${{ !env.ACT }}
#if: ${{ !env.ACT }}
with:
path: |
target
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/gnostr-bot-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -223,14 +223,14 @@ jobs:
if: ${{ steps.time_check_second.outputs.is_even == 'true' }}
run: |
echo "✅ Running job for an EVEN UTC second."
cargo test
cargo test --lib

- name: 🌙 Run if UTC second is ODD
# The 'if' condition checks if the boolean output is NOT true (i.e., it's false).
if: ${{ steps.time_check_second.outputs.is_even != 'true' }}
run: |
echo "✅ Running job for an ODD UTC second."
cargo test -- --ignored || true
cargo test --lib -- --ignored || true
# Add your odd-second steps here

- run: |
Expand Down
51 changes: 31 additions & 20 deletions .github/workflows/gnostr-bot-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
- name: Restore rustup
id: cache-rustup-restore
uses: actions/cache/restore@v3
if: ${{ !env.ACT }}
#if: ${{ !env.ACT }}
with:
path: |
~/.rustup
Expand All @@ -81,7 +81,7 @@ jobs:
- name: Restore cargo
id: cache-cargo-restore
uses: actions/cache/restore@v3
if: ${{ !env.ACT }}
#if: ${{ !env.ACT }}
with:
path: |
~/.cargo
Expand All @@ -90,7 +90,7 @@ jobs:
- name: Restore target
id: cache-target-restore
uses: actions/cache/restore@v3
if: ${{ !env.ACT }}
#if: ${{ !env.ACT }}
with:
path: |
target
Expand All @@ -113,27 +113,31 @@ jobs:

- run: cargo-binstall --no-confirm gnostr

- run: /bin/bash -c "sudo apt-get install build-essential procps curl file git"
if: matrix.os == 'ubuntu-latest'
#- run: /bin/bash -c "sudo apt-get install build-essential procps curl file git"
# if: matrix.os == 'ubuntu-latest'

- run: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
if: matrix.os != 'windows-latest'
if: matrix.os == 'macos-latest'
#if: matrix.os != 'windows-latest'

- run: |
test -d ~/.linuxbrew && eval "$(~/.linuxbrew/bin/brew shellenv)"
test -d /home/linuxbrew/.linuxbrew && eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
echo "eval \"\$($(brew --prefix)/bin/brew shellenv)\"" >> ~/.bashrc
brew install gnostr-org/gnostr-org/gnostr && gnostr --help
if: matrix.os == 'ubuntu-latest'
#- run: |
# test -d ~/.linuxbrew && eval "$(~/.linuxbrew/bin/brew shellenv)"
# test -d /home/linuxbrew/.linuxbrew && eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
# echo "eval \"\$($(brew --prefix)/bin/brew shellenv)\"" >> ~/.bashrc
# brew install gnostr-org/gnostr-org/gnostr && gnostr --help
# if: matrix.os == 'ubuntu-latest'

- run: brew tap gnostr-org/homebrew-gnostr-org || true
if: matrix.os != 'windows-latest'
if: matrix.os == 'macos-latest'
#if: matrix.os != 'windows-latest'

- run: brew tap nostorg/nostr || true
if: matrix.os != 'windows-latest'
if: matrix.os == 'macos-latest'
#if: matrix.os != 'windows-latest'

- run: brew tap randymcmillan/homebrew-randymcmillan || true
if: matrix.os != 'windows-latest'
if: matrix.os == 'macos-latest'
#if: matrix.os != 'windows-latest'

- run: brew install gnostr-org/gnostr-org/gnostr && gnostr --help
if: matrix.os == 'macos-latest'
Expand Down Expand Up @@ -210,14 +214,21 @@ jobs:
if: ${{ steps.time_check_second.outputs.is_even == 'true' }} && matrix.os != 'windows-latest'
run: |
echo "✅ Running job for an EVEN UTC second."
cargo test
cargo clean

- name: 🚀 Run if UTC second is EVEN
# The 'if' condition checks the boolean output from the previous step.
if: ${{ steps.time_check_second.outputs.is_even == 'true' }}
run: |
echo "✅ Running job for an EVEN UTC second."
cargo test --lib

- name: 🌙 Run if UTC second is ODD
# The 'if' condition checks if the boolean output is NOT true (i.e., it's false).
if: ${{ steps.time_check_second.outputs.is_even != 'true' }} && matrix.os != 'windows-latest'
run: |
echo "✅ Running job for an ODD UTC second."
cargo test -- --ignored || true
cargo test --lib -- --ignored || true
# Add your odd-second steps here

- run: |
Expand Down Expand Up @@ -338,23 +349,23 @@ jobs:
- name: Save rustup
id: cache-rustup-save
uses: actions/cache/save@v3
if: ${{ !env.ACT }}
#if: ${{ !env.ACT }}
with:
path: |
~/.rustup
key: ${{ steps.cache-rustup-restore.outputs.cache-primary-key }}
- name: Save cargo
id: cache-cargo-save
uses: actions/cache/save@v3
if: ${{ !env.ACT }}
#if: ${{ !env.ACT }}
with:
path: |
~/.cargo
key: ${{ steps.cache-cargo-restore.outputs.cache-primary-key }}
- name: Save target
id: cache-target-save
uses: actions/cache/save@v3
if: ${{ !env.ACT }}
#if: ${{ !env.ACT }}
with:
path: |
target
Expand Down
Loading