From adc3be223e8e0d1ee8e11c834616762571da2799 Mon Sep 17 00:00:00 2001 From: Nebay <122096646+nebay-abraha@users.noreply.github.com> Date: Mon, 4 Nov 2024 21:51:54 +0000 Subject: [PATCH 1/3] ci.yml --- .github/workflows/main.yml | 92 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..817c806 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,92 @@ +name: Build, Deploy, Test, and Analyze with CodeQL + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + # schedule: + # - cron: '30 14 * * 3' + workflow_dispatch: + +jobs: + # CodeQL Analysis Job + analyze: + name: CodeQL Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'python' ] + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + with: + languages: ${{ matrix.language }} + + - name: Autobuild + uses: github/codeql-action/autobuild@v1 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 + + # Build, Deploy, and Test Job + build: + runs-on: ubuntu-latest + needs: analyze + + steps: + - name: Check out the rspace-client-python code + uses: actions/checkout@v3 + + - name: Clone rspace-docker repository + run: | + git clone https://github.com/rspace-os/rspace-docker.git + working-directory: rspace-docker + + - name: Download rspace.war + run: | + curl -L -o rspace.war https://github.com/rspace-os/rspace-web/releases/download/2.4.0/researchspace-2.4.0.war + + - name: Start Docker Compose + run: | + cd rspace-docker + docker-compose up -d + + - name: Run Healthcheck + run: | + until docker inspect --format "{{json .State.Health.Status }}" rspace-db | grep -q "healthy"; do + echo "Waiting for database to be healthy..." + sleep 5 + done + echo "Database is healthy!" + + - name: Set up Poetry + run: | + curl -sSL https://install.python-poetry.org | python3 - + echo 'export PATH="$HOME/.local/bin:$PATH"' >> $GITHUB_ENV + + - name: Install dependencies with Poetry + run: | + cd rspace-client-python + poetry install + + - name: Set environment variables + env: + RSPACE_URL: "http://localhost:8080" + RSPACE_API_KEY: ${{ secrets.RSPACE_API_KEY }} + run: echo "Environment variables set" + + # - name: Run Tests + # run: | + # cd rspace-client-python + # poetry run pytest rspace_client/tests From 39bd009c944d55dcadc988ece0dd535f757c4b4d Mon Sep 17 00:00:00 2001 From: nebay-abraha Date: Wed, 6 Nov 2024 13:20:54 +0000 Subject: [PATCH 2/3] update codeQlv2 --- .github/workflows/codeql-analysis.yml | 8 +-- .github/workflows/main.yml | 92 --------------------------- 2 files changed, 3 insertions(+), 97 deletions(-) delete mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index dd737d8..6192533 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -42,7 +42,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v1 + uses: github/codeql-action/init@v2 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -53,8 +53,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@v1 - + uses: github/codeql-action/autobuild@v2 # â„šī¸ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -65,6 +64,5 @@ jobs: #- run: | # make bootstrap # make release - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 + uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index 817c806..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,92 +0,0 @@ -name: Build, Deploy, Test, and Analyze with CodeQL - -on: - push: - branches: [ main, master ] - pull_request: - branches: [ main, master ] - # schedule: - # - cron: '30 14 * * 3' - workflow_dispatch: - -jobs: - # CodeQL Analysis Job - analyze: - name: CodeQL Analyze - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: [ 'python' ] - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Initialize CodeQL - uses: github/codeql-action/init@v1 - with: - languages: ${{ matrix.language }} - - - name: Autobuild - uses: github/codeql-action/autobuild@v1 - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 - - # Build, Deploy, and Test Job - build: - runs-on: ubuntu-latest - needs: analyze - - steps: - - name: Check out the rspace-client-python code - uses: actions/checkout@v3 - - - name: Clone rspace-docker repository - run: | - git clone https://github.com/rspace-os/rspace-docker.git - working-directory: rspace-docker - - - name: Download rspace.war - run: | - curl -L -o rspace.war https://github.com/rspace-os/rspace-web/releases/download/2.4.0/researchspace-2.4.0.war - - - name: Start Docker Compose - run: | - cd rspace-docker - docker-compose up -d - - - name: Run Healthcheck - run: | - until docker inspect --format "{{json .State.Health.Status }}" rspace-db | grep -q "healthy"; do - echo "Waiting for database to be healthy..." - sleep 5 - done - echo "Database is healthy!" - - - name: Set up Poetry - run: | - curl -sSL https://install.python-poetry.org | python3 - - echo 'export PATH="$HOME/.local/bin:$PATH"' >> $GITHUB_ENV - - - name: Install dependencies with Poetry - run: | - cd rspace-client-python - poetry install - - - name: Set environment variables - env: - RSPACE_URL: "http://localhost:8080" - RSPACE_API_KEY: ${{ secrets.RSPACE_API_KEY }} - run: echo "Environment variables set" - - # - name: Run Tests - # run: | - # cd rspace-client-python - # poetry run pytest rspace_client/tests From eebc61ebbd505fc2aa947b9fa4a159f31bb98ddc Mon Sep 17 00:00:00 2001 From: nebay-abraha Date: Thu, 14 Nov 2024 09:11:25 +0000 Subject: [PATCH 3/3] (chore) upgrade codeql v3 --- .github/workflows/codeql-analysis.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 6192533..0cd9400 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -38,11 +38,11 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@v3 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -53,7 +53,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@v2 + uses: github/codeql-action/autobuild@v3 # â„šī¸ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -65,4 +65,4 @@ jobs: # make bootstrap # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@v3