From c6da8b3db1525abe5a0d1e397545a1c8b261475d Mon Sep 17 00:00:00 2001 From: philipp Date: Wed, 17 Jan 2024 18:09:29 +0100 Subject: [PATCH 01/19] try --- .dockerignore | 6 ++++++ .gitea/workflows/action.yml | 43 ++++--------------------------------- Dockerfile | 19 ++++++++++++++++ 3 files changed, 29 insertions(+), 39 deletions(-) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..cf6570b --- /dev/null +++ b/.dockerignore @@ -0,0 +1,6 @@ +target/ +db.sqlite +.history/ +frontend/node_modules/* +/static/ +/data-ergo/ diff --git a/.gitea/workflows/action.yml b/.gitea/workflows/action.yml index 493fbc9..19a21ab 100644 --- a/.gitea/workflows/action.yml +++ b/.gitea/workflows/action.yml @@ -7,16 +7,12 @@ env: SSH_HOST: ${{ secrets.SSH_HOST }} SSH_USER: ${{ secrets.SSH_USER }} SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} - CARGO_INCREMENTAL: 0 jobs: test-frontend: runs-on: ubuntu-latest - container: rust:latest + container: git.hofer.link/ruderverein-donau-linz/rowing-ci:latest steps: - - name: Setup Environment - run: | - apt-get update -qq && apt-get install -y -qq sshpass musl musl-tools sqlite3 curl gnupg && mkdir -p /etc/apt/keyrings | curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_16.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && apt-get update && apt-get install nodejs -y && apt-get install npm -y - uses: actions/checkout@v3 - name: Run Test DB Script run: ./test_db.sh @@ -26,8 +22,6 @@ jobs: cd frontend && npm install && npm run build - name: Install dependencies run: cd frontend && npm install - - name: Install Playwright Browsers - run: cd frontend && npx playwright install --with-deps - name: Run Playwright tests run: cd frontend && npx playwright test --workers 1 #- uses: actions/upload-artifact@v3 @@ -39,13 +33,9 @@ jobs: test-backend: runs-on: ubuntu-latest - container: rust:latest + container: git.hofer.link/ruderverein-donau-linz/rowing-ci:latest steps: - - name: Setup Environment - run: | - apt-get update -qq && apt-get install -y -qq sshpass musl musl-tools sqlite3 curl gnupg && mkdir -p /etc/apt/keyrings | curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_16.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && apt-get update && apt-get install nodejs -y && apt-get install npm -y - - name: Checkout uses: actions/checkout@v3 @@ -62,30 +52,10 @@ jobs: deploy-staging: runs-on: ubuntu-latest - container: rust:latest + container: git.hofer.link/ruderverein-donau-linz/rowing-ci:latest needs: [test_frontend, test_backend] if: github.ref == 'refs/heads/staging' steps: - - name: Setup Environment - run: | - rustup target add $CARGO_TARGET - apt-get update -qq && apt-get install -y -qq pkg-config sshpass musl musl-tools sqlite3 curl gnupg libssl-dev - - # Handling NodeSource GPG key - curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key -o nodesource.gpg.key - if [ -f /etc/apt/keyrings/nodesource.gpg ]; then - rm /etc/apt/keyrings/nodesource.gpg - fi - gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg nodesource.gpg.key - - # Adding NodeSource repository - echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_16.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list - - # Installing Node.js and npm - apt-get update - apt-get install nodejs -y - apt-get install npm -y - - name: Checkout uses: actions/checkout@v3 @@ -122,15 +92,10 @@ jobs: deploy-main: runs-on: ubuntu-latest - container: rust:latest + container: git.hofer.link/ruderverein-donau-linz/rowing-ci:latest needs: [test_frontend, test_backend] if: github.ref == 'refs/heads/main' steps: - - name: Setup Environment - run: | - rustup target add $CARGO_TARGET - apt-get update -qq && apt-get install -y -qq pkg-config sshpass musl musl-tools sqlite3 curl gnupg libssl-dev && mkdir -p /etc/apt/keyrings | curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_16.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && apt-get update && apt-get install nodejs -y && apt-get install npm -y - - name: Checkout uses: actions/checkout@v3 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..dfda4da --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM rust:latest + +# COPY . / + + +RUN apt-get update && apt-get install -y sqlite3 + +# nodejs +RUN apt-get install -y curl && \ + curl -sL https://deb.nodesource.com/setup_21.x | bash - && \ + apt-get install -y nodejs + +# playwright +RUN npx playwright install --with-deps + +# deployment +RUN rustup target add x86_64-unknown-linux-musl +RUN apt-get install -y -qq pkg-config sshpass musl musl-tools curl gnupg libssl-dev + From cf1cd0c126eecdda8b4064f77e9dc3f13690db34 Mon Sep 17 00:00:00 2001 From: philipp Date: Wed, 17 Jan 2024 18:21:44 +0100 Subject: [PATCH 02/19] explain dockerfile --- Dockerfile | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index dfda4da..c2b6eb8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,12 @@ +# This dockerfile is used as basis for the CI jobs. +# Process to renew it: +# 0. Login to gitea docker registry: `docker login git.hofer.link` +# 1. Build the image `docker build .` +# 2. Tag the image: `docker tag git.hofer.link/ruderverein-donau-linz/rowing-ci:latest` +# 3. Push the image: `docker push git.hofer.link/ruderverein-donau-linz/rowing-ci:latest` + FROM rust:latest -# COPY . / - - RUN apt-get update && apt-get install -y sqlite3 # nodejs @@ -16,4 +20,3 @@ RUN npx playwright install --with-deps # deployment RUN rustup target add x86_64-unknown-linux-musl RUN apt-get install -y -qq pkg-config sshpass musl musl-tools curl gnupg libssl-dev - From 4af887c2b4a8663c66ed1bca5f1527c3028dae01 Mon Sep 17 00:00:00 2001 From: philipp Date: Wed, 17 Jan 2024 18:32:18 +0100 Subject: [PATCH 03/19] try --- .gitea/workflows/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/action.yml b/.gitea/workflows/action.yml index 19a21ab..459069c 100644 --- a/.gitea/workflows/action.yml +++ b/.gitea/workflows/action.yml @@ -11,7 +11,7 @@ env: jobs: test-frontend: runs-on: ubuntu-latest - container: git.hofer.link/ruderverein-donau-linz/rowing-ci:latest + container: ruderverein-donau-linz/rowing-ci:latest steps: - uses: actions/checkout@v3 - name: Run Test DB Script From 1f734b75a0937d3a5e850d8ff2faa82f6e33f36a Mon Sep 17 00:00:00 2001 From: philipp Date: Wed, 17 Jan 2024 18:35:29 +0100 Subject: [PATCH 04/19] try --- .gitea/workflows/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/action.yml b/.gitea/workflows/action.yml index 459069c..19a21ab 100644 --- a/.gitea/workflows/action.yml +++ b/.gitea/workflows/action.yml @@ -11,7 +11,7 @@ env: jobs: test-frontend: runs-on: ubuntu-latest - container: ruderverein-donau-linz/rowing-ci:latest + container: git.hofer.link/ruderverein-donau-linz/rowing-ci:latest steps: - uses: actions/checkout@v3 - name: Run Test DB Script From 62171d72fe953a2345524e68a5dd0f68f7bb37e3 Mon Sep 17 00:00:00 2001 From: philipp Date: Wed, 17 Jan 2024 19:06:12 +0100 Subject: [PATCH 05/19] try --- .gitea/workflows/action.yml | 33 ++++++++------------------------- Dockerfile | 2 +- 2 files changed, 9 insertions(+), 26 deletions(-) diff --git a/.gitea/workflows/action.yml b/.gitea/workflows/action.yml index 19a21ab..e3367be 100644 --- a/.gitea/workflows/action.yml +++ b/.gitea/workflows/action.yml @@ -9,9 +9,10 @@ env: SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} jobs: - test-frontend: + test: runs-on: ubuntu-latest - container: git.hofer.link/ruderverein-donau-linz/rowing-ci:latest + container: + image: git.hofer.link/ruderverein-donau-linz/rowing-ci:20240117 steps: - uses: actions/checkout@v3 - name: Run Test DB Script @@ -20,10 +21,10 @@ jobs: run: | cargo build cd frontend && npm install && npm run build - - name: Install dependencies - run: cd frontend && npm install - name: Run Playwright tests run: cd frontend && npx playwright test --workers 1 + - name: Run Tests + run: cargo test --verbose #- uses: actions/upload-artifact@v3 # if: always() # with: @@ -31,29 +32,11 @@ jobs: # path: frontend/playwright-report/ # retention-days: 30 - test-backend: - runs-on: ubuntu-latest - container: git.hofer.link/ruderverein-donau-linz/rowing-ci:latest - - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Run Test DB Script - run: ./test_db.sh - - - name: Build - run: | - cargo build - cd frontend && npm install && npm run build - - - name: Run Tests - run: cargo test --verbose deploy-staging: runs-on: ubuntu-latest - container: git.hofer.link/ruderverein-donau-linz/rowing-ci:latest - needs: [test_frontend, test_backend] + image: git.hofer.link/ruderverein-donau-linz/rowing-ci:20240117 + needs: [test] if: github.ref == 'refs/heads/staging' steps: - name: Checkout @@ -93,7 +76,7 @@ jobs: deploy-main: runs-on: ubuntu-latest container: git.hofer.link/ruderverein-donau-linz/rowing-ci:latest - needs: [test_frontend, test_backend] + needs: [test] if: github.ref == 'refs/heads/main' steps: - name: Checkout diff --git a/Dockerfile b/Dockerfile index c2b6eb8..081b6f8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ # 2. Tag the image: `docker tag git.hofer.link/ruderverein-donau-linz/rowing-ci:latest` # 3. Push the image: `docker push git.hofer.link/ruderverein-donau-linz/rowing-ci:latest` -FROM rust:latest +FROM rust:1.75.0 RUN apt-get update && apt-get install -y sqlite3 From b258a5ac6e2d739be0412884d830bfc2598ac00e Mon Sep 17 00:00:00 2001 From: philipp Date: Wed, 17 Jan 2024 19:07:37 +0100 Subject: [PATCH 06/19] try --- .gitea/workflows/action.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/action.yml b/.gitea/workflows/action.yml index e3367be..92e5b4e 100644 --- a/.gitea/workflows/action.yml +++ b/.gitea/workflows/action.yml @@ -11,8 +11,7 @@ env: jobs: test: runs-on: ubuntu-latest - container: - image: git.hofer.link/ruderverein-donau-linz/rowing-ci:20240117 + container: git.hofer.link/ruderverein-donau-linz/rowing-ci:20240117 steps: - uses: actions/checkout@v3 - name: Run Test DB Script @@ -35,7 +34,7 @@ jobs: deploy-staging: runs-on: ubuntu-latest - image: git.hofer.link/ruderverein-donau-linz/rowing-ci:20240117 + container: git.hofer.link/ruderverein-donau-linz/rowing-ci:20240117 needs: [test] if: github.ref == 'refs/heads/staging' steps: From 865c55cd18713dde4c5cbbbd58b3d0caac8ec661 Mon Sep 17 00:00:00 2001 From: philipp Date: Wed, 17 Jan 2024 19:28:13 +0100 Subject: [PATCH 07/19] try --- .gitea/workflows/action.yml | 42 +++++++++++++++++++++++++++++++++++-- Dockerfile | 4 ++-- 2 files changed, 42 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/action.yml b/.gitea/workflows/action.yml index 92e5b4e..373a3a0 100644 --- a/.gitea/workflows/action.yml +++ b/.gitea/workflows/action.yml @@ -16,13 +16,25 @@ jobs: - uses: actions/checkout@v3 - name: Run Test DB Script run: ./test_db.sh + - name: Set up cargo cache + uses: actions/cache@v3 + continue-on-error: false + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: ${{ runner.os }}-cargo- - name: Build run: | cargo build cd frontend && npm install && npm run build - - name: Run Playwright tests + - name: Frontend tests run: cd frontend && npx playwright test --workers 1 - - name: Run Tests + - name: Backend tests run: cargo test --verbose #- uses: actions/upload-artifact@v3 # if: always() @@ -44,6 +56,19 @@ jobs: - name: Run Test DB Script run: ./test_db.sh + - name: Set up cargo cache + uses: actions/cache@v3 + continue-on-error: false + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: ${{ runner.os }}-cargo- + - name: Build run: | cargo build --release --target $CARGO_TARGET @@ -84,6 +109,19 @@ jobs: - name: Run Test DB Script run: ./test_db.sh + - name: Set up cargo cache + uses: actions/cache@v3 + continue-on-error: false + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: ${{ runner.os }}-cargo- + - name: Build run: | cargo build --release --target $CARGO_TARGET diff --git a/Dockerfile b/Dockerfile index 081b6f8..92d1e73 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,8 +2,8 @@ # Process to renew it: # 0. Login to gitea docker registry: `docker login git.hofer.link` # 1. Build the image `docker build .` -# 2. Tag the image: `docker tag git.hofer.link/ruderverein-donau-linz/rowing-ci:latest` -# 3. Push the image: `docker push git.hofer.link/ruderverein-donau-linz/rowing-ci:latest` +# 2. Tag the image: `docker tag git.hofer.link/ruderverein-donau-linz/rowing-ci:` +# 3. Push the image: `docker push git.hofer.link/ruderverein-donau-linz/rowing-ci:` FROM rust:1.75.0 From 7be76f3ce8e310a25faff8c8f7310183dea4a281 Mon Sep 17 00:00:00 2001 From: philipp Date: Wed, 17 Jan 2024 19:45:21 +0100 Subject: [PATCH 08/19] try --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index d6afcc6..e12e2af 100644 --- a/README.md +++ b/README.md @@ -19,4 +19,3 @@ ## Backend (Unit + Integration) `cargo t` - From 0b7711ed91471c27706033135512f0fc8795ebbf Mon Sep 17 00:00:00 2001 From: philipp Date: Wed, 17 Jan 2024 19:49:46 +0100 Subject: [PATCH 09/19] try --- .gitea/workflows/action.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/action.yml b/.gitea/workflows/action.yml index 373a3a0..2131724 100644 --- a/.gitea/workflows/action.yml +++ b/.gitea/workflows/action.yml @@ -1,6 +1,12 @@ name: CI/CD Pipeline -on: push +on: + workflow_call: + inputs: + rust-version: + type: string + required: false + default: nightly env: CARGO_TARGET: x86_64-unknown-linux-musl From 5fec65e38fe5b90f0f30405a1079db42e3e2f254 Mon Sep 17 00:00:00 2001 From: philipp Date: Wed, 17 Jan 2024 19:50:32 +0100 Subject: [PATCH 10/19] try --- .gitea/workflows/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/action.yml b/.gitea/workflows/action.yml index 2131724..36d1a33 100644 --- a/.gitea/workflows/action.yml +++ b/.gitea/workflows/action.yml @@ -1,7 +1,7 @@ name: CI/CD Pipeline on: - workflow_call: + push: inputs: rust-version: type: string From d0adee74daf022a465914bac8127b1fe952278df Mon Sep 17 00:00:00 2001 From: philipp Date: Wed, 17 Jan 2024 19:52:54 +0100 Subject: [PATCH 11/19] try --- .gitea/workflows/action.yml | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/.gitea/workflows/action.yml b/.gitea/workflows/action.yml index 36d1a33..a775888 100644 --- a/.gitea/workflows/action.yml +++ b/.gitea/workflows/action.yml @@ -1,12 +1,6 @@ name: CI/CD Pipeline -on: - push: - inputs: - rust-version: - type: string - required: false - default: nightly +on: push env: CARGO_TARGET: x86_64-unknown-linux-musl @@ -22,18 +16,18 @@ jobs: - uses: actions/checkout@v3 - name: Run Test DB Script run: ./test_db.sh + - name: Set up cargo cache uses: actions/cache@v3 - continue-on-error: false with: path: | ~/.cargo/bin/ ~/.cargo/registry/index/ ~/.cargo/registry/cache/ ~/.cargo/git/db/ - target/ + target/ key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - restore-keys: ${{ runner.os }}-cargo- + - name: Build run: | cargo build From 079467170724dd27995583c2fb0bb0aa5cd5aad3 Mon Sep 17 00:00:00 2001 From: philipp Date: Wed, 17 Jan 2024 20:14:55 +0100 Subject: [PATCH 12/19] try --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 92d1e73..6e7caf6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,6 +5,7 @@ # 2. Tag the image: `docker tag git.hofer.link/ruderverein-donau-linz/rowing-ci:` # 3. Push the image: `docker push git.hofer.link/ruderverein-donau-linz/rowing-ci:` + FROM rust:1.75.0 RUN apt-get update && apt-get install -y sqlite3 From ba132a57350722529965418b62e4c423a8547ae2 Mon Sep 17 00:00:00 2001 From: philipp Date: Wed, 17 Jan 2024 20:35:06 +0100 Subject: [PATCH 13/19] try --- .gitea/workflows/action.yml | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/.gitea/workflows/action.yml b/.gitea/workflows/action.yml index a775888..397a9a7 100644 --- a/.gitea/workflows/action.yml +++ b/.gitea/workflows/action.yml @@ -17,6 +17,8 @@ jobs: - name: Run Test DB Script run: ./test_db.sh + - name: TEMPORARY act workaround + run: apt update && apt install zstd - name: Set up cargo cache uses: actions/cache@v3 with: @@ -56,19 +58,6 @@ jobs: - name: Run Test DB Script run: ./test_db.sh - - name: Set up cargo cache - uses: actions/cache@v3 - continue-on-error: false - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - restore-keys: ${{ runner.os }}-cargo- - - name: Build run: | cargo build --release --target $CARGO_TARGET @@ -109,19 +98,6 @@ jobs: - name: Run Test DB Script run: ./test_db.sh - - name: Set up cargo cache - uses: actions/cache@v3 - continue-on-error: false - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - restore-keys: ${{ runner.os }}-cargo- - - name: Build run: | cargo build --release --target $CARGO_TARGET From 57c1e13c144c54767f2e638a313cc42e32136e2c Mon Sep 17 00:00:00 2001 From: philipp Date: Wed, 17 Jan 2024 21:22:57 +0100 Subject: [PATCH 14/19] try --- .gitea/workflows/action.yml | 8 +++----- Dockerfile | 3 +++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/action.yml b/.gitea/workflows/action.yml index 397a9a7..ef369de 100644 --- a/.gitea/workflows/action.yml +++ b/.gitea/workflows/action.yml @@ -11,14 +11,12 @@ env: jobs: test: runs-on: ubuntu-latest - container: git.hofer.link/ruderverein-donau-linz/rowing-ci:20240117 + container: git.hofer.link/ruderverein-donau-linz/rowing-ci:20240118 steps: - uses: actions/checkout@v3 - name: Run Test DB Script run: ./test_db.sh - - name: TEMPORARY act workaround - run: apt update && apt install zstd - name: Set up cargo cache uses: actions/cache@v3 with: @@ -48,7 +46,7 @@ jobs: deploy-staging: runs-on: ubuntu-latest - container: git.hofer.link/ruderverein-donau-linz/rowing-ci:20240117 + container: git.hofer.link/ruderverein-donau-linz/rowing-ci:20240118 needs: [test] if: github.ref == 'refs/heads/staging' steps: @@ -88,7 +86,7 @@ jobs: deploy-main: runs-on: ubuntu-latest - container: git.hofer.link/ruderverein-donau-linz/rowing-ci:latest + container: git.hofer.link/ruderverein-donau-linz/rowing-ci:20240118 needs: [test] if: github.ref == 'refs/heads/main' steps: diff --git a/Dockerfile b/Dockerfile index 6e7caf6..bf52e2a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,3 +21,6 @@ RUN npx playwright install --with-deps # deployment RUN rustup target add x86_64-unknown-linux-musl RUN apt-get install -y -qq pkg-config sshpass musl musl-tools curl gnupg libssl-dev + +# TEMPORARY act workaround (otherwise gitea cache is not working) +RUN apt-get install -y zstd From 88d533c838928d857fe8a3f1b205b7fb42f43d5d Mon Sep 17 00:00:00 2001 From: philipp Date: Wed, 17 Jan 2024 22:43:54 +0100 Subject: [PATCH 15/19] try --- README.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/README.md b/README.md index e12e2af..96d2517 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,14 @@ # Build - ## Frontend 1. `cd frontend` 2. `npm install` 3. `npm run (watch/build)` # Run - ## Backend 1. `cargo r` # Test - ## Frontend - `npx playwright test --workers 1 --project firefox` - Nice UI: `--ui` From 6bee538b55172a5d26064d060d43b5cfff3ce1bd Mon Sep 17 00:00:00 2001 From: philipp Date: Wed, 17 Jan 2024 22:52:31 +0100 Subject: [PATCH 16/19] try --- .gitea/workflows/action.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.gitea/workflows/action.yml b/.gitea/workflows/action.yml index ef369de..91b1957 100644 --- a/.gitea/workflows/action.yml +++ b/.gitea/workflows/action.yml @@ -56,6 +56,17 @@ jobs: - name: Run Test DB Script run: ./test_db.sh + - name: Set up cargo cache + uses: actions/cache@v3 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + - name: Build run: | cargo build --release --target $CARGO_TARGET @@ -95,6 +106,17 @@ jobs: - name: Run Test DB Script run: ./test_db.sh + + - name: Set up cargo cache + uses: actions/cache@v3 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - name: Build run: | From 22ee941ce0a0963285d1256d2e313f28b073b2cf Mon Sep 17 00:00:00 2001 From: philipp Date: Wed, 17 Jan 2024 23:08:28 +0100 Subject: [PATCH 17/19] try --- .gitea/workflows/action.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/action.yml b/.gitea/workflows/action.yml index 91b1957..e153627 100644 --- a/.gitea/workflows/action.yml +++ b/.gitea/workflows/action.yml @@ -26,7 +26,7 @@ jobs: ~/.cargo/registry/cache/ ~/.cargo/git/db/ target/ - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + key: ${{ runner.os }}-cargo-debug-${{ hashFiles('**/Cargo.lock') }} - name: Build run: | @@ -65,7 +65,7 @@ jobs: ~/.cargo/registry/cache/ ~/.cargo/git/db/ target/ - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + key: ${{ runner.os }}-cargo-release-${{ hashFiles('**/Cargo.lock') }} - name: Build run: | @@ -116,7 +116,7 @@ jobs: ~/.cargo/registry/cache/ ~/.cargo/git/db/ target/ - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + key: ${{ runner.os }}-cargo-release-${{ hashFiles('**/Cargo.lock') }} - name: Build run: | From 95fb07f1e9ddfbc974276eeb1f0a0d6d418cd926 Mon Sep 17 00:00:00 2001 From: philipp Date: Wed, 17 Jan 2024 23:23:58 +0100 Subject: [PATCH 18/19] try --- .gitea/workflows/action.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/action.yml b/.gitea/workflows/action.yml index e153627..387962b 100644 --- a/.gitea/workflows/action.yml +++ b/.gitea/workflows/action.yml @@ -75,7 +75,7 @@ jobs: - name: Deploy to Staging run: | - mkdir ~/.ssh + mkdir -p ~/.ssh ssh-keyscan -H $SSH_HOST >> ~/.ssh/known_hosts echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa chmod 600 ~/.ssh/id_rsa @@ -124,9 +124,9 @@ jobs: strip target/$CARGO_TARGET/release/rot cd frontend && npm install && npm run build - - name: Deploy to Main + - name: Deploy to production run: | - mkdir ~/.ssh + mkdir -p ~/.ssh ssh-keyscan -H $SSH_HOST >> ~/.ssh/known_hosts echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa chmod 600 ~/.ssh/id_rsa From 03947001d5c39c1e65f605d2a469e32f351e4de4 Mon Sep 17 00:00:00 2001 From: philipp Date: Wed, 17 Jan 2024 23:34:39 +0100 Subject: [PATCH 19/19] try --- .gitea/workflows/action.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitea/workflows/action.yml b/.gitea/workflows/action.yml index 387962b..3c5fafc 100644 --- a/.gitea/workflows/action.yml +++ b/.gitea/workflows/action.yml @@ -27,6 +27,7 @@ jobs: ~/.cargo/git/db/ target/ key: ${{ runner.os }}-cargo-debug-${{ hashFiles('**/Cargo.lock') }} + restore-keys: ${{ runner.os }}-cargo-debug- - name: Build run: | @@ -66,6 +67,8 @@ jobs: ~/.cargo/git/db/ target/ key: ${{ runner.os }}-cargo-release-${{ hashFiles('**/Cargo.lock') }} + restore-keys: ${{ runner.os }}-cargo-release- + - name: Build run: | @@ -117,6 +120,7 @@ jobs: ~/.cargo/git/db/ target/ key: ${{ runner.os }}-cargo-release-${{ hashFiles('**/Cargo.lock') }} + restore-keys: ${{ runner.os }}-cargo-release- - name: Build run: |