From becd1b99e6acea0054090946fd790029bb0d415d Mon Sep 17 00:00:00 2001 From: philipp Date: Sat, 18 Nov 2023 21:54:11 +0100 Subject: [PATCH] push --- .gitea/workflows/action.yml | 44 ++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/.gitea/workflows/action.yml b/.gitea/workflows/action.yml index 2ebb599..4b9bb5c 100644 --- a/.gitea/workflows/action.yml +++ b/.gitea/workflows/action.yml @@ -13,31 +13,28 @@ env: SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} jobs: - setup-environment: - runs-on: ubuntu-latest - outputs: - cache-key: ${{ steps.cache-keys.outputs.cache-key }} - steps: - - name: Calculate Cache Keys - id: cache-keys - run: echo "::set-output name=cache-key::$(date +%s)" - build: runs-on: ubuntu-latest - needs: setup-environment - container: my-custom-container:latest steps: - name: Checkout uses: actions/checkout@v3 - - name: Restore Cache - uses: actions/cache@v3 + - name: Setup Rust Environment + uses: actions-rs/toolchain@v1 with: - path: | - ~/.cargo - ./frontend/node_modules - key: ${{ needs.setup-environment.outputs.cache-key }} + toolchain: stable + target: $CARGO_TARGET + override: true + + - name: Install Dependencies + run: | + sudo apt-get update -qq + sudo apt-get install -y -qq sshpass musl musl-tools sqlite3 curl gnupg + curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /tmp/nodesource.gpg + echo "deb [signed-by=/tmp/nodesource.gpg] https://deb.nodesource.com/node_16.x $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/nodesource.list + sudo apt-get update + sudo apt-get install -y nodejs npm - name: Run Test DB Script run: ./test_db.sh @@ -60,17 +57,16 @@ jobs: test: runs-on: ubuntu-latest needs: build - container: my-custom-container:latest steps: - name: Checkout uses: actions/checkout@v3 - - name: Restore Cache - uses: actions/cache@v3 + - name: Setup Rust Environment + uses: actions-rs/toolchain@v1 with: - path: ~/.cargo - key: ${{ needs.setup-environment.outputs.cache-key }} + toolchain: stable + override: true - name: Run Tests run: cargo test --verbose @@ -100,6 +96,7 @@ jobs: ssh $SSH_USER@$SSH_HOST 'rm /home/k004373/rowing-staging/db.sqlite && cp /home/k004373/rowing/db.sqlite /home/k004373/rowing-staging/db.sqlite && mkdir -p /home/k004373/rowing-staging/svelte/build && mkdir -p /home/k004373/rowing-staging/data-ergo/thirty && mkdir -p /home/k004373/rowing-staging/data-ergo/dozen && sqlite3 /home/k004373/rowing-staging/db.sqlite < /home/k004373/rowing-staging/staging-diff.sql' ssh $SSH_USER@$SSH_HOST 'mv /home/k004373/rowing-staging/rot-updating /home/k004373/rowing-staging/rot' ssh $SSH_USER@$SSH_HOST 'sudo systemctl start rotstaging' + env: SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} SSH_HOST: ${{ secrets.SSH_HOST }} @@ -113,7 +110,7 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 - + - name: Download Artifacts uses: actions/download-artifact@v3 with: @@ -129,6 +126,7 @@ jobs: ssh $SSH_USER@$SSH_HOST 'sudo systemctl stop rot' ssh $SSH_USER@$SSH_HOST 'mv /home/k004373/rowing/rot-updating /home/k004373/rowing/rot' ssh $SSH_USER@$SSH_HOST 'sudo systemctl start rot' + env: SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} SSH_HOST: ${{ secrets.SSH_HOST }}