Sync your own workout data from your "Strong" app
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

added pipelines

+226 -1
+114
.github/workflows/build-and-test.yml
··· 1 + name: Build and Test 2 + 3 + on: [pull_request] 4 + 5 + env: 6 + CARGO_TERM_COLOR: always 7 + 8 + jobs: 9 + format: 10 + name: Format Check 11 + runs-on: ubuntu-latest 12 + steps: 13 + - uses: actions/checkout@v4 14 + - uses: actions/cache@v4 15 + with: 16 + path: | 17 + ~/.cargo/bin/ 18 + ~/.cargo/registry/index/ 19 + ~/.cargo/registry/cache/ 20 + ~/.cargo/git/db/ 21 + target/ 22 + key: ${{ runner.os }}-cargo-check-${{ hashFiles('**/Cargo.lock') }} 23 + restore-keys: ${{ runner.os }}-cargo-check- 24 + - name: Run Format 25 + run: cargo fmt --all -- --check 26 + 27 + test: 28 + name: Test 29 + runs-on: ubuntu-latest 30 + steps: 31 + - uses: actions/checkout@v4 32 + - uses: actions/cache@v4 33 + with: 34 + path: | 35 + ~/.cargo/bin/ 36 + ~/.cargo/registry/index/ 37 + ~/.cargo/registry/cache/ 38 + ~/.cargo/git/db/ 39 + target/ 40 + key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock') }} 41 + restore-keys: ${{ runner.os }}-cargo-test- 42 + - name: Test 43 + run: cargo test --profile ci 44 + 45 + clippy: 46 + name: Clippy 47 + runs-on: ubuntu-latest 48 + steps: 49 + - uses: actions/checkout@v4 50 + - uses: actions/cache@v4 51 + with: 52 + path: | 53 + ~/.cargo/bin/ 54 + ~/.cargo/registry/index/ 55 + ~/.cargo/registry/cache/ 56 + ~/.cargo/git/db/ 57 + target/ 58 + key: ${{ runner.os }}-cargo-clippy-${{ hashFiles('**/Cargo.lock') }} 59 + restore-keys: ${{ runner.os }}-cargo-clippy- 60 + - name: Run Clippy 61 + run: cargo clippy --all-targets --all-features --profile ci 62 + 63 + semver: 64 + name: Semver Check (strong-api-lib) 65 + runs-on: ubuntu-latest 66 + steps: 67 + - uses: actions/checkout@v4 68 + - uses: actions/checkout@v4 69 + with: 70 + ref: ${{ github.event.pull_request.base.ref }} 71 + path: .old 72 + - name: Check semver 73 + uses: obi1kenobi/cargo-semver-checks-action@v2 74 + with: 75 + manifest-path: strong-api-lib/Cargo.toml 76 + baseline-root: .old 77 + 78 + bumped_version: 79 + name: Bumped Version Check 80 + runs-on: ubuntu-latest 81 + steps: 82 + - uses: actions/checkout@v4 83 + with: 84 + fetch-depth: 2 85 + - name: Ensure version bump in Cargo.toml (if applicable) 86 + run: | 87 + BASE_BRANCH="${{ github.event.pull_request.base.ref }}" 88 + git fetch origin "$BASE_BRANCH" 89 + for DIR in "strong-api-lib" "strong-api-fetch" 90 + do 91 + echo "Checking $DIR" 92 + CHANGED_FILES=$(git diff --name-only origin/"$BASE_BRANCH"...HEAD -- "$DIR") 93 + echo "Changed files:" 94 + echo "$CHANGED_FILES" 95 + 96 + NON_CONFIG_FILES=$(echo "$CHANGED_FILES" | grep -vE '\.(yml|yaml|md)$' || true) 97 + 98 + if [ -z "$NON_CONFIG_FILES" ]; then 99 + echo "Only YAML, Markdown, or similar files changed. Skipping version bump check." 100 + continue 101 + fi 102 + 103 + BASE_VERSION=$(git show origin/"$BASE_BRANCH":"$DIR"/Cargo.toml | grep '^version' | head -n 1 | cut -d '"' -f2) 104 + PR_VERSION=$(grep '^version' "$DIR"/Cargo.toml | head -n 1 | cut -d '"' -f2) 105 + echo "Base version: $BASE_VERSION" 106 + echo "PR version: $PR_VERSION" 107 + 108 + if [ "$BASE_VERSION" = "$PR_VERSION" ]; then 109 + echo "Error: version not bumped in $DIR! Please update the version in Cargo.toml." 110 + exit 1 111 + else 112 + echo "Version bump detected in $DIR." 113 + fi 114 + done
+107
.github/workflows/deploy.yml
··· 1 + name: Test and Deploy 2 + 3 + on: 4 + push: 5 + branches: 6 + - master 7 + workflow_dispatch: 8 + 9 + env: 10 + CARGO_TERM_COLOR: always 11 + 12 + permissions: 13 + contents: write 14 + 15 + jobs: 16 + test: 17 + if: github.event_name != 'workflow_dispatch' 18 + name: Test 19 + runs-on: ubuntu-latest 20 + steps: 21 + - uses: actions/checkout@v4 22 + - name: Test 23 + run: cargo test 24 + 25 + tag: 26 + if: github.event_name != 'workflow_dispatch' 27 + name: Create Git Tag 28 + needs: test 29 + runs-on: ubuntu-latest 30 + steps: 31 + - uses: actions/checkout@v4 32 + with: 33 + fetch-depth: 0 34 + - name: Extract version from Cargo.toml 35 + run: | 36 + VERSION=$(grep '^version' strong-api-fetch/Cargo.toml | head -n 1 | sed -E 's/version *= *"([^"]+)".*/\1/') 37 + echo "VERSION=$VERSION" >> $GITHUB_ENV 38 + echo "Version extracted: $VERSION" 39 + - name: Check existing tag 40 + id: check_tag 41 + run: | 42 + LATEST="$(git tag --sort=-v:refname | head -n 1 || echo "")" 43 + echo "Latest tag: $LATEST" 44 + if [ "$LATEST" = "$VERSION" ]; then 45 + echo "Tag is up-to-date. No new tag needed." 46 + echo "tag_created=false" >> $GITHUB_OUTPUT 47 + else 48 + echo "New version detected: $VERSION" 49 + echo "tag_created=true" >> $GITHUB_OUTPUT 50 + fi 51 + - name: Create and push Git tag 52 + if: steps.check_tag.outputs.tag_created == 'true' 53 + run: | 54 + git config user.name "github-actions" 55 + git config user.email "github-actions@github.com" 56 + git tag "$VERSION" 57 + git push origin "$VERSION" 58 + 59 + deploy: 60 + if: github.event_name == 'workflow_dispatch' 61 + name: Deploy to Server 62 + runs-on: ubuntu-latest 63 + environment: 64 + name: production 65 + steps: 66 + - uses: actions/checkout@v4 67 + - name: Extract version from Cargo.toml 68 + run: | 69 + VERSION=$(grep '^version' strong-api-fetch/Cargo.toml | head -n 1 | sed -E 's/version *= *"([^"]+)".*/\1/') 70 + echo "VERSION=$VERSION" >> $GITHUB_ENV 71 + echo "Version extracted: $VERSION" 72 + - name: SSH into Server and Deploy 73 + env: 74 + PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} 75 + SSH_USER: ${{ secrets.SSH_USER }} 76 + SSH_HOST: ${{ secrets.SSH_HOST }} 77 + SSH_PATH: ${{ secrets.SSH_PATH }} 78 + VERSION: ${{ env.VERSION }} 79 + run: | 80 + echo "$PRIVATE_KEY" > private_key.pem 81 + chmod 600 private_key.pem 82 + 83 + ssh -o StrictHostKeyChecking=no -i private_key.pem $SSH_USER@$SSH_HOST <<EOF 84 + set -e 85 + cd $SSH_PATH && \ 86 + git fetch origin --tags && \ 87 + git checkout "refs/tags/$VERSION" && \ 88 + docker build -t strong-api-fetch:"$VERSION" --build-arg VERSION="$VERSION" . && \ 89 + docker stop strong-api-fetch || true && \ 90 + sleep 3 && \ 91 + docker rm strong-api-fetch || true && \ 92 + sleep 1 && \ 93 + SSH_PATH=$SSH_PATH VERSION=$VERSION docker compose up -d && \ 94 + sleep 3 && \ 95 + if [ \$(docker ps -q -f name=strong-api-fetch | wc -l) -eq 0 ]; then 96 + echo "WARN: Container takes more time than usual to spin up" && \ 97 + sleep 4 && \ 98 + if [ \$(docker ps -q -f name=strong-api-fetch | wc -l) -eq 0 ]; then 99 + echo "ERROR: Container failed to start. Showing logs:" && \ 100 + docker logs strong-api-fetch && \ 101 + exit 1 102 + fi 103 + fi 104 + echo "Deployment successful - container is running" 105 + EOF 106 + 107 + rm -f private_key.pem
+5 -1
Cargo.toml
··· 3 3 members = [ 4 4 "strong-api-lib", 5 5 "strong-api-fetch" 6 - ] 6 + ] 7 + 8 + [profile.ci] 9 + inherits = "dev" 10 + opt-level = 1