From 308de38a02ea8f6940f6781244c3359c93307d11 Mon Sep 17 00:00:00 2001 From: Avery Black Date: Tue, 18 Oct 2022 11:21:35 -0700 Subject: [PATCH 1/5] Update actions --- .github/workflows/main.yml | 44 +++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ec47f5da3e..fbe594c893 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -30,11 +30,11 @@ jobs: steps: # Checkout code. - - uses: actions/checkout@v1 + - uses: actions/checkout@v3 # Setup Node.js - name: Setup Node.js - uses: actions/setup-node@v3.4.1 + uses: actions/setup-node@v3 with: node-version: 14 @@ -57,7 +57,7 @@ jobs: steps: # Checkout code. - name: Checkout code - uses: actions/checkout@v1 + uses: actions/checkout@v3 # Fetch tags. - name: Fetch tags @@ -65,7 +65,7 @@ jobs: # Install Java 11. - name: Install Java 11 - uses: actions/setup-java@v1 + uses: actions/setup-java@v3 with: java-version: 11 @@ -85,12 +85,12 @@ jobs: # Publish Coverage Report. - name: Publish Server Coverage Report - uses: codecov/codecov-action@v1 + uses: codecov/codecov-action@v3 with: file: ./photon-server/build/reports/jacoco/test/jacocoTestReport.xml - name: Publish Core Coverage Report - uses: codecov/codecov-action@v1 + uses: codecov/codecov-action@v3 with: file: ./photon-core/build/reports/jacoco/test/jacocoTestReport.xml @@ -99,13 +99,13 @@ jobs: steps: # Checkout docs. - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: repository: 'PhotonVision/photonvision-docs.git' ref: master # Install Python. - - uses: actions/setup-python@v2 + - uses: actions/setup-python@v4 with: python-version: '3.6' @@ -136,10 +136,10 @@ jobs: steps: # Checkout code. - - uses: actions/checkout@v1 + - uses: actions/checkout@v3 # Install Java 11. - - uses: actions/setup-java@v1 + - uses: actions/setup-java@v3 with: java-version: 11 @@ -168,10 +168,10 @@ jobs: runs-on: ${{ matrix.os }} name: "Photonlib - Build - ${{ matrix.artifact-name }}" steps: - - uses: actions/checkout@v2.3.4 + - uses: actions/checkout@v3 with: fetch-depth: 0 - - uses: actions/setup-java@v1 + - uses: actions/setup-java@v3 with: java-version: 11 - run: git fetch --tags --force @@ -200,10 +200,10 @@ jobs: container: ${{ matrix.container }} name: "Photonlib - Build - ${{ matrix.artifact-name }}" steps: - - uses: actions/checkout@v2.3.4 + - uses: actions/checkout@v3 with: fetch-depth: 0 - - uses: actions/setup-java@v1 + - uses: actions/setup-java@v3 with: java-version: 11 - run: | @@ -220,14 +220,14 @@ jobs: name: "wpiformat" runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Fetch all history and metadata run: | git fetch --prune --unshallow git checkout -b pr git branch -f master origin/master - name: Set up Python 3.8 - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: 3.8 - name: Install clang-format @@ -244,7 +244,7 @@ jobs: - name: Generate diff run: git diff HEAD > wpiformat-fixes.patch if: ${{ failure() }} - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: name: wpiformat fixes path: wpiformat-fixes.patch @@ -258,10 +258,10 @@ jobs: steps: # Checkout code. - - uses: actions/checkout@v1 + - uses: actions/checkout@v3 # Install Java 11. - - uses: actions/setup-java@v1 + - uses: actions/setup-java@v3 with: java-version: 11 @@ -271,13 +271,13 @@ jobs: mkdir -p photon-server/src/main/resources/web/docs # Download client artifact to resources folder. - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: built-client path: photon-server/src/main/resources/web/ # Download docs artifact to resources folder. - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: built-docs path: photon-server/src/main/resources/web/docs @@ -296,7 +296,7 @@ jobs: ./scripts/generatePiImage.sh # Upload final fat jar as artifact. - - uses: actions/upload-artifact@master + - uses: actions/upload-artifact@v3 with: name: jar path: photon-server/build/libs From 0ca36b01ca4f4c28ff752d6402f4472d7b27dbd5 Mon Sep 17 00:00:00 2001 From: Avery Black Date: Tue, 18 Oct 2022 11:25:26 -0700 Subject: [PATCH 2/5] Set java distribution --- .github/workflows/main.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fbe594c893..e3948f7d80 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -68,6 +68,7 @@ jobs: uses: actions/setup-java@v3 with: java-version: 11 + distribution: temurin # Run Gradle build. - name: Gradle Build @@ -142,6 +143,7 @@ jobs: - uses: actions/setup-java@v3 with: java-version: 11 + distribution: temurin # Check server code with Spotless. - run: | @@ -174,6 +176,7 @@ jobs: - uses: actions/setup-java@v3 with: java-version: 11 + distribution: temurin - run: git fetch --tags --force - run: | chmod +x gradlew @@ -206,6 +209,7 @@ jobs: - uses: actions/setup-java@v3 with: java-version: 11 + distribution: temurin - run: | chmod +x gradlew ./gradlew photon-lib:build --max-workers 1 @@ -264,6 +268,7 @@ jobs: - uses: actions/setup-java@v3 with: java-version: 11 + distribution: temurin # Clear any existing web resources. - run: | From e23a292d79a0dd733da76ea95f8365ddf5473ed8 Mon Sep 17 00:00:00 2001 From: Avery Black Date: Thu, 20 Oct 2022 21:32:30 -0700 Subject: [PATCH 3/5] Don't attempt to upload image if not a PR --- .github/workflows/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e3948f7d80..056587859b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -305,7 +305,8 @@ jobs: with: name: jar path: photon-server/build/libs - - uses: actions/upload-artifact@master + - uses: actions/upload-artifact@v3 + if: github.event_name != 'pull_request' with: name: image path: photonvision*.zip From 7e720d995d923b1eb5068b7e5a04587cff2586aa Mon Sep 17 00:00:00 2001 From: Avery Black Date: Thu, 20 Oct 2022 21:40:58 -0700 Subject: [PATCH 4/5] Try not pulling a node container --- .github/workflows/main.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 056587859b..602ba184b4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,10 +24,6 @@ jobs: # The type of runner that the job will run on. runs-on: ubuntu-latest - # Grab the docker container. - container: - image: docker://node:10 - steps: # Checkout code. - uses: actions/checkout@v3 @@ -36,7 +32,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v3 with: - node-version: 14 + node-version: 16 # Run npm - run: | From dda5eba5df16f18421acb7e50e0a323f4fbbe66c Mon Sep 17 00:00:00 2001 From: Avery Black Date: Thu, 20 Oct 2022 22:03:50 -0700 Subject: [PATCH 5/5] Seperate out npm commands to help debug NPM error If the error ever wants to re-appear (ugh) --- .github/workflows/main.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 602ba184b4..869b043fb7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -35,10 +35,9 @@ jobs: node-version: 16 # Run npm - - run: | - npm install -g npm - npm ci - npm run build --if-present + - run: npm update -g npm + - run: npm ci + - run: npm run build --if-present # Upload client artifact. - uses: actions/upload-artifact@master