From 816a71b423a61c94ac8b2e302f3bd9763559ae25 Mon Sep 17 00:00:00 2001 From: Kimo Knowles Date: Thu, 25 Apr 2024 09:17:32 +0200 Subject: [PATCH] [wip] test CI --- .../continuous-deployment-workflow.yml | 127 ------------------ .../continuous-integration-workflow.yml | 80 ++++++++--- .github/workflows/docs-workflow.yml | 74 ---------- 3 files changed, 64 insertions(+), 217 deletions(-) delete mode 100644 .github/workflows/continuous-deployment-workflow.yml delete mode 100644 .github/workflows/docs-workflow.yml diff --git a/.github/workflows/continuous-deployment-workflow.yml b/.github/workflows/continuous-deployment-workflow.yml deleted file mode 100644 index c00ff54e..00000000 --- a/.github/workflows/continuous-deployment-workflow.yml +++ /dev/null @@ -1,127 +0,0 @@ -name: cd -on: - push: - tags: - - "v[0-9]+.[0-9]+.[0-9]+*" - -jobs: - test: - name: Test - runs-on: ubuntu-22.04 - - steps: - - uses: actions/checkout@v1 - - - name: Setup java - uses: actions/setup-java@v3 - with: - distribution: 'temurin' - java-version: '21' - - - name: Install clojure tools - uses: DeLaGuardo/setup-clojure@12.5 - with: - cli: 'latest' - bb: 'latest' - - - name: Cache clojure dependencies - uses: actions/cache@v3 - with: - path: | - ~/.m2/repository - ~/.gitlibs - ~/.deps.clj - ~/.npm - .shadow-cljs - key: cljdeps-${{ hashFiles('deps.edn') }}-${{ hashFiles ('package.json') }}-${{ hashFiles ('package-lock.json') }} - restore-keys: cljdeps- - - - name: Fix git dubious directory ownership error - run: git config --global --add safe.directory /__w/re-com/re-com - - - run: lein prod-once - - - name: Slack notification - uses: homoluctus/slatify@v2.0.1 - if: failure() || cancelled() - with: - type: ${{ job.status }} - job_name: re-com Tests - channel: '#oss-robots' - url: ${{ secrets.SLACK_WEBHOOK }} - commit: true - token: ${{ secrets.GITHUB_TOKEN }} - - release: - name: Release - needs: test - runs-on: ubuntu-22.04 - - env: - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - CLOJARS_USERNAME: ${{ secrets.CLOJARS_USERNAME }} - CLOJARS_TOKEN: ${{ secrets.CLOJARS_TOKEN }} - - steps: - - uses: actions/checkout@v1 - - - name: Setup java - uses: actions/setup-java@v3 - with: - distribution: 'temurin' - java-version: '21' - - - name: Install clojure tools - uses: DeLaGuardo/setup-clojure@12.5 - with: - cli: 'latest' - bb: 'latest' - - - name: Cache clojure dependencies - uses: actions/cache@v3 - with: - path: | - ~/.m2/repository - ~/.gitlibs - ~/.deps.clj - ~/.npm - .shadow-cljs - key: cljdeps-${{ hashFiles('deps.edn') }}-${{ hashFiles ('package.json') }}-${{ hashFiles ('package-lock.json') }} - restore-keys: cljdeps- - - - run: lein release - env: - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - CLOJARS_USERNAME: ${{ secrets.CLOJARS_USERNAME }} - CLOJARS_TOKEN: ${{ secrets.CLOJARS_TOKEN }} - GITHUB_USERNAME: ${{ github.actor }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - # This creates a 'GitHub Release' from the tag and includes link to CHANGELOG.md at the current - # git ref. We do not use draft or prerelease features as we always want - # the latest release to show in the right hand column of the project page regardless - # of if it is a stable release. - - name: Create GitHub Release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ github.ref }} - release_name: ${{ github.ref }} - body: | - [Changelog](https://github.com/day8/re-com/blob/master/CHANGELOG.md) - draft: false - prerelease: false - - - name: Slack notification - uses: homoluctus/slatify@v2.0.1 - if: always() - with: - type: ${{ job.status }} - job_name: re-com Deployment - channel: '#oss-robots' - url: ${{ secrets.SLACK_WEBHOOK }} - commit: true - token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/continuous-integration-workflow.yml b/.github/workflows/continuous-integration-workflow.yml index 903f1a3d..8dba19db 100644 --- a/.github/workflows/continuous-integration-workflow.yml +++ b/.github/workflows/continuous-integration-workflow.yml @@ -36,25 +36,73 @@ jobs: key: cljdeps-${{ hashFiles('deps.edn') }}-${{ hashFiles ('package.json') }}-${{ hashFiles ('package-lock.json') }} restore-keys: cljdeps- + - name: Install chrome dependencies + uses: awalsh128/cache-apt-pkgs-action@latest + with: + packages: | + libgconf-2-4 + fonts-liberation + libasound2 + libatk-bridge2.0-0 + libatk1.0-0 + libatspi2.0-0 + libcairo2 + libgbm-dev + libgbm1 + libgdk-pixbuf2.0-0 + libgtk-3-0 + libgtk-3-0 + libnss3-dev + libpango-1.0-0 + libxdamage1 + libxkbcommon0 + libxss-dev + xdg-utils + + - uses: browser-actions/setup-chrome@v1 + id: setup-chrome + with: + chrome-version: 812859 + + #- run: export CHROME_BIN=${{ steps.setup-chrome.outputs.chrome-path }} + - run: export CHROME_BIN=chromium + # TODO: https://github.com/browser-actions/setup-chrome/issues/527 + - name: setup chromedriver + run: | + export CHROMEDRIVER_VERSION="87.0.4280.0" + export CHROMEDRIVER_SHA256SUM="1412212c24d7e24a0bb3969aac125e576729cbbe5321413af16e2eb2be4b5db3" + export CHROMEDRIVER_PACKAGE_URL="https://www.googleapis.com/download/storage/v1/b/chromium-browser-snapshots/o/Linux_x64%2F812859%2Fchromedriver_linux64.zip?generation=1601581780133920&alt=media" + wget -q -O chromedriver_linux64.zip $CHROMEDRIVER_PACKAGE_URL + sha256sum chromedriver_linux64.zip + echo "$CHROMEDRIVER_SHA256SUM *chromedriver_linux64.zip" | sha256sum -c - + unzip -q chromedriver_linux64.zip + rm -f chromedriver_linux64.zip + mv chromedriver_linux64/chromedriver /usr/local/bin/chromedriver + chmod +x /usr/local/bin/chromedriver + - name: Fix git dubious directory ownership error run: git config --global --add safe.directory /__w/re-com/re-com + - run: echo $CHROME_BIN + - run: echo ${{ steps.setup-chrome.outputs.chrome-path }} - - run: bb ci - + - run: id && bb ci + env: + CHROME_BIN: ${{ steps.setup-chrome.outputs.chrome-path }} + - run: bb build-report-ci - - uses: actions/upload-artifact@v4 - with: - name: build-report - path: target/build-report.html + # - uses: actions/upload-artifact@v4 + # with: + # name: build-report + # path: target/build-report.html - - name: Slack notification - uses: homoluctus/slatify@v2.0.1 - if: failure() || cancelled() - with: - type: ${{ job.status }} - job_name: re-com Tests - channel: '#oss-robots' - url: ${{ secrets.SLACK_WEBHOOK }} - commit: true - token: ${{ secrets.GITHUB_TOKEN }} + # - name: Slack notification + # uses: homoluctus/slatify@v2.0.1 + # if: failure() || cancelled() + # with: + # type: ${{ job.status }} + # job_name: re-com Tests + # channel: '#oss-robots' + # url: ${{ secrets.SLACK_WEBHOOK }} + # commit: true + # token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/docs-workflow.yml b/.github/workflows/docs-workflow.yml deleted file mode 100644 index 15c555d4..00000000 --- a/.github/workflows/docs-workflow.yml +++ /dev/null @@ -1,74 +0,0 @@ -name: re-com.day8.com.au -on: - push: - branches: - - master - -jobs: - deploy: - name: Deploy - runs-on: ubuntu-22.04 - - env: - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - CLOJARS_USERNAME: ${{ secrets.CLOJARS_USERNAME }} - CLOJARS_TOKEN: ${{ secrets.CLOJARS_TOKEN }} - - steps: - - uses: actions/checkout@v1 - - - name: Setup java - uses: actions/setup-java@v3 - with: - distribution: 'temurin' - java-version: '21' - - - name: Install clojure tools - uses: DeLaGuardo/setup-clojure@12.5 - with: - cli: 'latest' - bb: 'latest' - - - name: Cache clojure dependencies - uses: actions/cache@v3 - with: - path: | - ~/.m2/repository - ~/.gitlibs - ~/.deps.clj - ~/.npm - .shadow-cljs - key: cljdeps-${{ hashFiles('deps.edn') }}-${{ hashFiles ('package.json') }}-${{ hashFiles ('package-lock.json') }} - restore-keys: cljdeps- - - - run: bb deploy-aws - env: - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - CLOJARS_USERNAME: ${{ secrets.CLOJARS_USERNAME }} - CLOJARS_TOKEN: ${{ secrets.CLOJARS_TOKEN }} - GITHUB_USERNAME: ${{ github.actor }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - AWS_EC2_METADATA_DISABLED: true - - - name: Invalidate CloudFront Distribution - uses: chetan/invalidate-cloudfront-action@master - env: - DISTRIBUTION: ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID }} - PATHS: '/*' - AWS_REGION: 'us-east-1' - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - - - name: Slack notification - uses: homoluctus/slatify@v2.0.1 - if: always() - with: - type: ${{ job.status }} - job_name: re-com.day8.com.au Deployment - username: "Github Actions" - channel: '#oss-robots' - url: ${{ secrets.SLACK_WEBHOOK }} - commit: true - token: ${{ secrets.GITHUB_TOKEN }}