gnostr:cargo apply fmt/sort #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: gnostr | |
# Controls when the action will run. | |
on: | |
pull_request: | |
branches: | |
- '*' | |
- '*/*' | |
- '**' | |
- 'master' | |
- 'main' | |
push: | |
branches: | |
- '*' | |
- '*/*' | |
- '**' | |
- 'master' | |
- 'main' | |
workflow_dispatch: | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
build: | |
env: | |
GNOSTR: "gnostr" | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: echo test | |
#if: ${{ !env.ACT }} | |
run: | | |
echo GNOSTR=${{ env.GNOSTR }} | |
echo GNOSTR1=${{ env.GNOSTR1 }} | |
env: | |
GNOSTR1: "GNOSTR1" | |
- uses: styfle/[email protected] | |
if: ${{ !env.ACT }} | |
with: | |
access_token: ${{ github.token }} | |
- name: Restore deps | |
id: cache-deps-restore | |
uses: actions/cache/restore@v3 | |
if: ${{ !env.ACT }} | |
with: | |
path: | | |
~/.rustup | |
key: ${{ runner.os }}-deps | |
- uses: actions/checkout@v3 | |
with: | |
submodules: 'true' | |
set-safe-directory: 'true' | |
fetch-depth: '10' | |
- uses: actions-rs/[email protected] | |
#if: ${{ !env.ACT }} | |
with: | |
toolchain: stable | |
default: true | |
override: true | |
## objective: streamline gnostr installation on macos/brewlinux | |
- run: brew tap gnostr-org/homebrew-gnostr-org || true | |
if: github.event_name == 'pull_request' && matrix.os == 'macos-latest' | |
## objective: streamline gnostr installation on macos/brewlinux | |
- run: brew tap nostorg/nostr || true | |
if: github.event_name == 'pull_request' && matrix.os == 'macos-latest' | |
- run: rustup default stable | |
- run: cargo search gnostr --limit 100 | |
- run: mkdir -p ~/bin | |
#- run: for t in */Cargo.toml;do echo $t;cargo b -r -vv --manifest-path $t ;done | |
## objective: ensure make detect installs all needed depends/libs/etc | |
## make detect is first for brew install sequence OR sudo make detect for apt install | |
- run: make detect || sudo make detect | |
- run: python3 -m pip install virtualenv | |
## objective: test non-cmake build gnostr-am | |
- run: make gnostr-am gnostr-install | |
- run: make gnostr-sha256 gnostr-bins | |
- run: gnostr-am --sec $(gnostr-sha256 $(gnostr-weeble)) --content $(gnostr-weeble)/$(gnostr-blockheight)/$(gnostr-wobble) -t gnostr --tag weeble $(gnostr-weeble) --tag blockheight $(gnostr-blockheight) --tag wobble $(gnostr-wobble) | |
## objective: test cmake build gnostr | |
## objective: test cargo build/install gnostr-bins | |
- run: cmake . | |
- run: V=1 make gnostr bins xq | |
- run: V=1 make gnostr-install | |
- run: V=1 make gnostr-verify-keypair | |
## objective: test cmake build gnostr with gnostr-nip | |
- run: gnostr-nip --sec $(gnostr-sha256) | gnostr-post-event | |
if: github.event_name == 'pull_request' | |
- run: gnostr-nip --sec $(gnostr-sha256 $(gnostr-weeble)) | gnostr-post-event | |
if: github.event_name == 'pull_request' | |
- run: gnostr-nip --sec $(gnostr-sha256 $(gnostr-weeble)$(gnostr-blockheight)) | gnostr-post-event | |
if: github.event_name == 'pull_request' | |
- run: gnostr-am --sec $(gnostr-sha256 $(gnostr-weeble)) --content $(gnostr-weeble)/$(gnostr-blockheight)/$(gnostr-wobble) -t gnostr --tag weeble $(gnostr-weeble) --tag blockheight $(gnostr-blockheight) --tag wobble $(gnostr-wobble) | |
if: github.event_name == 'pull_request' | |
- run: V=1 sudo make cat doc || true | |
if: github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true && matrix.os == 'ubuntu-matrix' | |
#TODO mode build script testing | |
#- name: ./build.cmake.sh | |
# if: github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true | |
# run: ./build.cmake.sh | |
- name: Save deps | |
id: cache-deps-save | |
uses: actions/cache/save@v3 | |
if: ${{ !env.ACT }} | |
with: | |
path: | | |
~/.rustup | |
key: ${{ steps.cache-deps-restore.outputs.cache-primary-key }} | |