From 0e60865c09a040779386f6bc8bd8862ab5e87082 Mon Sep 17 00:00:00 2001 From: Max Ostapenko <1611259+max-ostapenko@users.noreply.github.com> Date: Fri, 8 Nov 2024 19:08:55 +0100 Subject: [PATCH] upload workflow --- .github/workflows/test.yml | 2 +- .github/workflows/upload.yml | 45 ++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/upload.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 390a0b974..f82f0b972 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,7 +34,7 @@ jobs: WPT_SERVER: "webpagetest.httparchive.org" WPT_API_KEY: ${{ secrets.HA_API_KEY }} PR_NUMBER: ${{ github.event.pull_request.number }} - run: yarn test + run: yarn run test - name: Run WebPageTest for more websites id: wpt-test diff --git a/.github/workflows/upload.yml b/.github/workflows/upload.yml new file mode 100644 index 000000000..4640ec014 --- /dev/null +++ b/.github/workflows/upload.yml @@ -0,0 +1,45 @@ +name: Tests + +on: + push: + branches: + - main + paths: + - "src/technologies/*.json" + - "src/categories.json" + - "src/groups.json" + workflow_dispatch: + +jobs: + test: + name: Test and upload to GCP + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + fetch-depth: 0 + + - name: Install dependencies + run: yarn install + + - name: Validate + run: yarn run validate + + - name: Run WebPageTest with unit tests + id: unit-test + env: + WPT_SERVER: "webpagetest.httparchive.org" + WPT_API_KEY: ${{ secrets.HA_API_KEY }} + PR_NUMBER: ${{ github.event.pull_request.number }} + run: yarn run test + + - name: Upload to GCP + id: upload + env: + GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }} + GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }} + run: | + echo $GCP_SA_KEY > /tmp/gcp_key.json + yarn run upload