From cf4700a62c7785be9b4871d5d0a04c4a657861c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pimentel=20Ferreira?= Date: Fri, 24 May 2024 14:17:55 +0200 Subject: [PATCH 1/3] Update main_test.yml --- .github/workflows/main_test.yml | 84 ++++++++++++++++++++++++--------- 1 file changed, 62 insertions(+), 22 deletions(-) diff --git a/.github/workflows/main_test.yml b/.github/workflows/main_test.yml index 1a4145a1f47..65f465c3c5d 100644 --- a/.github/workflows/main_test.yml +++ b/.github/workflows/main_test.yml @@ -20,26 +20,66 @@ jobs: runs-on: ${{ matrix.platform }} steps: - - name: Main checkout - uses: actions/checkout@v4 - with: - path: main - - name: Checkout Node - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node-version }} - - name: Checkout resources private repo - uses: actions/checkout@v4 - with: - repository: geoapi-pt/resources - token: ${{ secrets.GH_PAT }} - path: resources - - name: List project root direcotory - run: ls ${GITHUB_WORKSPACE} -lh - - name: Install npm packages - run: | - cd ${GITHUB_WORKSPACE}/resources && npm ci - cd ${GITHUB_WORKSPACE}/main && npm ci - - name: Main Test - run: cd ${GITHUB_WORKSPACE}/main && npm test + - name: Check disk space + run: df . -h + - name: Free disk space + run: | + sudo docker rmi $(docker image ls -aq) >/dev/null 2>&1 || true + sudo rm -rf \ + /usr/share/dotnet /usr/local/lib/android /opt/ghc \ + /usr/local/share/powershell /usr/share/swift /usr/local/.ghcup \ + /usr/lib/jvm || true + echo "some directories deleted" + sudo apt install aptitude -y >/dev/null 2>&1 + sudo aptitude purge aria2 ansible azure-cli shellcheck rpm xorriso zsync \ + esl-erlang firefox gfortran-8 gfortran-9 google-chrome-stable \ + google-cloud-sdk imagemagick \ + libmagickcore-dev libmagickwand-dev libmagic-dev ant ant-optional kubectl \ + mercurial apt-transport-https mono-complete libmysqlclient \ + unixodbc-dev yarn chrpath libssl-dev libxft-dev \ + libfreetype6 libfreetype6-dev libfontconfig1 libfontconfig1-dev \ + snmp pollinate libpq-dev postgresql-client powershell ruby-full \ + sphinxsearch subversion mongodb-org azure-cli microsoft-edge-stable \ + -y -f >/dev/null 2>&1 + sudo aptitude purge google-cloud-sdk -f -y >/dev/null 2>&1 + sudo aptitude purge microsoft-edge-stable -f -y >/dev/null 2>&1 || true + sudo apt purge microsoft-edge-stable -f -y >/dev/null 2>&1 || true + sudo aptitude purge '~n ^mysql' -f -y >/dev/null 2>&1 + sudo aptitude purge '~n ^php' -f -y >/dev/null 2>&1 + sudo aptitude purge '~n ^dotnet' -f -y >/dev/null 2>&1 + sudo apt-get autoremove -y >/dev/null 2>&1 + sudo apt-get autoclean -y >/dev/null 2>&1 + echo "some packages purged" + - name: Check disk space + run: | + sudo dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -nr | head + df . -h + - name: Main checkout + uses: actions/checkout@v4 + with: + path: main + - name: Checkout Node + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + - name: Checkout resources private repo + uses: actions/checkout@v4 + with: + repository: geoapi-pt/resources + token: ${{ secrets.GH_PAT }} + path: resources + - name: Check project root direcotory and free extra space + run: | + ls ${GITHUB_WORKSPACE} -lh + du ${GITHUB_WORKSPACE} -h -d 1 + df . -h + sudo rm -rf ${GITHUB_WORKSPACE}/main/.git + sudo rm -rf ${GITHUB_WORKSPACE}/resources/.git + df . -h + - name: Install npm packages + run: | + cd ${GITHUB_WORKSPACE}/resources && npm ci + cd ${GITHUB_WORKSPACE}/main && npm ci + - name: Main Test + run: cd ${GITHUB_WORKSPACE}/main && npm test From e4810538dfbfc71263d6ab1f69979f3f2114477a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pimentel=20Ferreira?= Date: Fri, 24 May 2024 14:19:10 +0200 Subject: [PATCH 2/3] Delete .github/workflows/docker.yml --- .github/workflows/docker.yml | 104 ----------------------------------- 1 file changed, 104 deletions(-) delete mode 100644 .github/workflows/docker.yml diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml deleted file mode 100644 index 7ec15558210..00000000000 --- a/.github/workflows/docker.yml +++ /dev/null @@ -1,104 +0,0 @@ -name: Docker build and push - -on: - push: - branches: - - "main" - -jobs: - build: - runs-on: ubuntu-20.04 - steps: - - - name: Check disk space - run: df . -h - - - name: Free disk space - run: | - sudo docker rmi $(docker image ls -aq) >/dev/null 2>&1 || true - sudo rm -rf \ - /usr/share/dotnet /usr/local/lib/android /opt/ghc \ - /usr/local/share/powershell /usr/share/swift /usr/local/.ghcup \ - /usr/lib/jvm || true - echo "some directories deleted" - sudo apt install aptitude -y >/dev/null 2>&1 - sudo aptitude purge aria2 ansible azure-cli shellcheck rpm xorriso zsync \ - esl-erlang firefox gfortran-8 gfortran-9 google-chrome-stable \ - google-cloud-sdk imagemagick \ - libmagickcore-dev libmagickwand-dev libmagic-dev ant ant-optional kubectl \ - mercurial apt-transport-https mono-complete libmysqlclient \ - unixodbc-dev yarn chrpath libssl-dev libxft-dev \ - libfreetype6 libfreetype6-dev libfontconfig1 libfontconfig1-dev \ - snmp pollinate libpq-dev postgresql-client powershell ruby-full \ - sphinxsearch subversion mongodb-org azure-cli microsoft-edge-stable \ - -y -f >/dev/null 2>&1 - sudo aptitude purge google-cloud-sdk -f -y >/dev/null 2>&1 - sudo aptitude purge microsoft-edge-stable -f -y >/dev/null 2>&1 || true - sudo apt purge microsoft-edge-stable -f -y >/dev/null 2>&1 || true - sudo aptitude purge '~n ^mysql' -f -y >/dev/null 2>&1 - sudo aptitude purge '~n ^php' -f -y >/dev/null 2>&1 - sudo aptitude purge '~n ^dotnet' -f -y >/dev/null 2>&1 - sudo apt-get autoremove -y >/dev/null 2>&1 - sudo apt-get autoclean -y >/dev/null 2>&1 - echo "some packages purged" - - - name: Check disk space - run: | - sudo dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -nr | head - df . -h - - - name: Checkout Node - uses: actions/setup-node@v4 - with: - node-version: 16 - - - name: Checkout root repo - uses: actions/checkout@v4 - with: - repository: geoapi-pt/root - token: ${{ secrets.GH_PAT }} - - - name: Main Checkout - uses: actions/checkout@v4 - with: - path: main - - - name: Checkout resources private repo - uses: actions/checkout@v4 - with: - repository: geoapi-pt/resources - token: ${{ secrets.GH_PAT }} - path: resources - - - name: Check working space directory - run: du ${GITHUB_WORKSPACE} -h -d 1 - - - name: Get more space - run: | - df . -h - sudo rm -rf ${GITHUB_WORKSPACE}/main/.git - sudo rm -rf ${GITHUB_WORKSPACE}/resources/.git - df . -h - - - name: List project root direcotory - run: ls ${GITHUB_WORKSPACE} -lh - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - with: - driver: docker - - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Build and push - uses: docker/build-push-action@v5 - with: - context: . - file: ./Dockerfile - push: true - tags: ${{ secrets.DOCKER_USERNAME }}/geoapi.pt:latest - no-cache: true From 3d29c252e8200473291a62ea5e29dddafa8a8131 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pimentel=20Ferreira?= Date: Fri, 24 May 2024 15:17:03 +0200 Subject: [PATCH 3/3] Update main_test.yml --- .github/workflows/main_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main_test.yml b/.github/workflows/main_test.yml index 65f465c3c5d..4b657d7bf34 100644 --- a/.github/workflows/main_test.yml +++ b/.github/workflows/main_test.yml @@ -79,7 +79,7 @@ jobs: - name: Install npm packages run: | cd ${GITHUB_WORKSPACE}/resources && npm ci - cd ${GITHUB_WORKSPACE}/main && npm ci + cd ${GITHUB_WORKSPACE}/main && npm ci && npm run build-docs - name: Main Test run: cd ${GITHUB_WORKSPACE}/main && npm test