From 0f91844b13048775bf3b37478f80525453fc1f74 Mon Sep 17 00:00:00 2001 From: "@RandyMcMillan" Date: Sun, 30 Apr 2023 01:29:06 -0400 Subject: [PATCH] make: act-rs-relay: initial config & local build working --- ...ground-nostr-rs-relay.yml => rs-relay.yml} | 26 ++++++++++++++----- GNUmakefile | 1 + act.mk | 2 ++ 3 files changed, 23 insertions(+), 6 deletions(-) rename .github/workflows/{plebnet-playground-nostr-rs-relay.yml => rs-relay.yml} (80%) create mode 100755 act.mk diff --git a/.github/workflows/plebnet-playground-nostr-rs-relay.yml b/.github/workflows/rs-relay.yml similarity index 80% rename from .github/workflows/plebnet-playground-nostr-rs-relay.yml rename to .github/workflows/rs-relay.yml index b7991356..53f0464e 100644 --- a/.github/workflows/plebnet-playground-nostr-rs-relay.yml +++ b/.github/workflows/rs-relay.yml @@ -1,4 +1,4 @@ -name: plebnet-playground-nostr-rs-relay +name: rs-relay # Controls when the action will run. on: @@ -31,10 +31,11 @@ jobs: name: github-workspace strategy: matrix: - os: [ubuntu-20.04, ubuntu-latest] + os: [ubuntu-latest] runs-on: ${{ matrix.os }} steps: - uses: styfle/cancel-workflow-action@0.9.1 + if: ${{ !env.ACT }} with: access_token: ${{ github.token }} - name: Print github workspace @@ -44,10 +45,11 @@ jobs: latest-build_and_test: strategy: matrix: - os: [ ubuntu-latest, ubuntu-22.04 ] + os: [ubuntu-latest] runs-on: ${{ matrix.os }} steps: - uses: styfle/cancel-workflow-action@0.9.1 + if: ${{ !env.ACT }} with: access_token: ${{ github.token }} - uses: actions/checkout@v2 @@ -62,18 +64,25 @@ jobs: - name: make cargo-build/install run: | - make cargo-build - make cargo-install + export RUSTUP_INIT_SKIP_PATH_CHECK=yes + curl https://sh.rustup.rs -sSf | sh -s -- -y + source "$HOME/.cargo/env" && cargo b && cargo install --path . + #make cargo-build + #make cargo-install + macos-latest-cargo: + if: ${{ !env.ACT }} strategy: matrix: os: [ macos-latest ] runs-on: ${{ matrix.os }} steps: - uses: styfle/cancel-workflow-action@0.9.1 + if: ${{ !env.ACT }} with: access_token: ${{ github.token }} - uses: actions/checkout@v2 + if: ${{ !env.ACT }} - uses: actions/setup-python@v2 - uses: syphar/restore-virtualenv@v1 id: cache-virtualenv @@ -84,6 +93,11 @@ jobs: if: steps.cache-virtualenv.outputs.cache-hit != 'true' - name: make cargo-build/install + if: ${{ !env.ACT }} run: | + export RUSTUP_INIT_SKIP_PATH_CHECK=yes + curl https://sh.rustup.rs -sSf | sh -s -- -y + source $HOME/.cargo/env + make submodules make cargo-build - make cargo-install + diff --git a/GNUmakefile b/GNUmakefile index 7a9499fe..3d7048f2 100755 --- a/GNUmakefile +++ b/GNUmakefile @@ -112,5 +112,6 @@ run:## run restart:## restart @docker-compose restart -include cargo.mk +-include act.mk # vim: set noexpandtab: # vim: set setfiletype make diff --git a/act.mk b/act.mk new file mode 100755 index 00000000..9357ad7d --- /dev/null +++ b/act.mk @@ -0,0 +1,2 @@ +act-rs-relay:## run act -vr -W .github/workflows/rs-relay.yml + @pushd $(PWD) && export $(cat ~/GH_TOKEN.txt) && act -vr -W .github/workflows/rs-relay.yml && popd