From 8e25c7139bf456e13a72b20848ee08cddc289b9d Mon Sep 17 00:00:00 2001 From: Tom Hu <88201630+thomasrockhu-codecov@users.noreply.github.com> Date: Thu, 11 Jan 2024 08:34:59 -0800 Subject: [PATCH] chore(ci): add test-alpine job (#1388) * chore(ci): add test-alpine job * fix: add needs to test-alpine * fix: update permissions * test: add node version * fix: maybe its looking at fetched-v14.0.0 * fix: remove node -v * fix: downgrade undici * fix: test where file is * fix: use a relative filename * fix: create review and without-git jobs * fix: add alpine proxy job * fix: macos to osx * fix: reorder * fix: add squid * fix: typo windows -> win --- .github/workflows/test-and-deploy.yml | 245 +++++++++++++++++++++++++- npm-shrinkwrap.json | 16 +- package.json | 2 +- 3 files changed, 246 insertions(+), 17 deletions(-) diff --git a/.github/workflows/test-and-deploy.yml b/.github/workflows/test-and-deploy.yml index a574aae76..5da091332 100644 --- a/.github/workflows/test-and-deploy.yml +++ b/.github/workflows/test-and-deploy.yml @@ -8,15 +8,8 @@ on: # Remaining circleci jobs to port # - build-aarch64: -# - test-alpine: -# - test-alpine-proxy: -# - test-alpine-without-git: # - test-aarch64: # - test-aarch64-without-git: -# - test-linux-without-git: -# - test-macos-without-git: -# - test-windows-without-git: -# - review: # - deploy: # - release: @@ -48,7 +41,7 @@ jobs: build-alpine: runs-on: ubuntu-latest - container: alpine:3.18.4@sha256:eece025e432126ce23f223450a0326fbebde39cdf496a85d8c016293fc851978 + container: alpine:3.19.0@sha256:51b67269f354137895d43f3b3d810bfacd3945438e94dc5ac55fdac340352f48 needs: build-linux-and-osx steps: - name: Checkout @@ -150,6 +143,37 @@ jobs: path: | output_linux.txt + test-linux-without-git: + runs-on: ubuntu-latest + needs: build-linux-and-osx + steps: + - name: Checkout + uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 18 + - uses: actions/download-artifact@v3 + with: + name: artifact + - name: Remove .git directory + run: rm -rf .git + - name: Remove test coverage files + run: rm -rf *.coverage.txt coverage-report-test.json test/fixtures || echo + - name: Update exec permission + run: chmod u+x out/codecov-linux + - name: Run Linux binary (dry run) + run: | + out/codecov-linux -F linux-without-git -d -Z | tee -a output_linux_without_git.txt + - name: Run Linux binary (upload) + run: | + out/codecov-linux -F linux-without-git -Z -t ${{ secrets.CODECOV_TOKEN }} + - name: Upload artifacts + uses: actions/upload-artifact@v3 + with: + if-no-files-found: error + path: | + output_linux_without_git.txt + test-macos: runs-on: macos-latest needs: build-linux-and-osx @@ -179,6 +203,134 @@ jobs: path: | output_osx.txt + test-macos-without-git: + runs-on: macos-latest + needs: build-linux-and-osx + steps: + - name: Checkout + uses: actions/checkout@v4 + - uses: actions/download-artifact@v3 + with: + name: artifact + - name: Remove .git directory + run: rm -rf .git + - name: Remove test coverage files + run: rm -rf *.coverage.txt coverage-report-test.json test/fixtures || echo + - name: Update exec permission + run: chmod u+x out/codecov-macos + - name: Run MacOS binary (dry-run) + run: | + out/codecov-macos -F macos-without-git -v -d -Z -t ${{ secrets.CODECOV_TOKEN }} | tee -a output_osx_without_git.txt + - name: Run MacOS binary (upload) + run: | + out/codecov-macos -F macos-without-git -v -Z -t ${{ secrets.CODECOV_TOKEN }} + - name: Upload artifacts + uses: actions/upload-artifact@v3 + with: + if-no-files-found: error + path: | + output_osx_without_git.txt + + test-alpine: + runs-on: ubuntu-latest + container: alpine:3.19.0@sha256:51b67269f354137895d43f3b3d810bfacd3945438e94dc5ac55fdac340352f48 + needs: build-alpine + steps: + - name: Install git + run: | + apk update + apk add git + - name: Checkout + uses: actions/checkout@v4 + - uses: actions/download-artifact@v3 + with: + name: artifact + - name: Remove test coverage files + run: rm -rf *.coverage.txt coverage-report-test.json test/fixtures || echo + - name: Update exec permission + run: chmod u+x out/codecov-alpine + - name: Run Alpine binary -f (dry run) + run: | + NODE_DEBUG=vm out/codecov-alpine -v -f ./coverage-alpine/cobertura-coverage.xml -F alpine -d -Z -t ${{ secrets.CODECOV_TOKEN }} >> output_alpine.txt + - name: Run Alpine binary auto-detect (dry run) + run: | + out/codecov-alpine -F alpine -v -d -Z -t ${{ secrets.CODECOV_TOKEN }} >> output_alpine.txt + - name: Run Alpine binary (upload) + run: out/codecov-alpine -F alpine -v -Z -t ${{ secrets.CODECOV_TOKEN }} + - name: Upload artifacts + uses: actions/upload-artifact@v3 + with: + if-no-files-found: error + path: | + output_alpine.txt + + test-alpine-without-git: + runs-on: ubuntu-latest + container: alpine:3.19.0@sha256:51b67269f354137895d43f3b3d810bfacd3945438e94dc5ac55fdac340352f48 + needs: build-alpine + steps: + - name: Install git + run: | + apk update + apk add git + - name: Checkout + uses: actions/checkout@v4 + - uses: actions/download-artifact@v3 + with: + name: artifact + - name: Remove .git directory + run: rm -rf .git + - name: Remove test coverage files + run: rm -rf *.coverage.txt coverage-report-test.json test/fixtures || echo + - name: Update exec permission + run: chmod u+x out/codecov-alpine + - name: Run Alpine binary -f (dry run) + run: | + NODE_DEBUG=vm out/codecov-alpine -v -f ./coverage-alpine/cobertura-coverage.xml -F alpine-without-git -d -Z -t ${{ secrets.CODECOV_TOKEN }} >> output_alpine_without_git.txt + - name: Run Alpine binary auto-detect (dry run) + run: | + out/codecov-alpine -F alpine-without-git -v -d -Z -t ${{ secrets.CODECOV_TOKEN }} >> output_alpine_without_git.txt + - name: Run Alpine binary (upload) + run: out/codecov-alpine -F alpine-without-git -v -Z -t ${{ secrets.CODECOV_TOKEN }} + - name: Upload artifacts + uses: actions/upload-artifact@v3 + with: + if-no-files-found: error + path: | + output_alpine_without_git.txt + + test-alpine-proxy: + runs-on: ubuntu-latest + container: alpine:3.19.0@sha256:51b67269f354137895d43f3b3d810bfacd3945438e94dc5ac55fdac340352f48 + needs: build-alpine + steps: + - name: Install git + run: | + apk update + apk add git squid + - name: Checkout + uses: actions/checkout@v4 + - uses: actions/download-artifact@v3 + with: + name: artifact + - name: Start squid + run: squid + - name: Remove test coverage files + run: rm -rf *.coverage.txt coverage-report-test.json test/fixtures || echo + - name: Update exec permission + run: chmod u+x out/codecov-alpine + - name: Run Alpine binary auto-detect (dry run) + run: | + out/codecov-alpine -U http://localhost:3128 -F alpine-without-git -v -d -Z -t ${{ secrets.CODECOV_TOKEN }} >> output_alpine_proxy.txt + - name: Run Alpine binary (upload) + run: out/codecov-alpine -U http://localhost:3128 -F alpine-without-git -v -Z -t ${{ secrets.CODECOV_TOKEN }} + - name: Upload artifacts + uses: actions/upload-artifact@v3 + with: + if-no-files-found: error + path: | + output_alpine_proxy.txt + test-windows: runs-on: windows-latest needs: build-windows @@ -212,3 +364,80 @@ jobs: if-no-files-found: error path: | output_win.txt + + test-windows-without-git: + runs-on: windows-latest + needs: build-windows + steps: + - name: Checkout + uses: actions/checkout@v4 + - uses: actions/download-artifact@v3 + with: + name: artifact + - name: Remove .git directory + run: del -Recurse -Force .git + - name: Remove test coverage files + run: | + Remove-Item -Recurse -Force *.coverage.txt; echo "ok" + Remove-Item -Recurse -Force test/fixtures; echo "ok" + - name: Run Windows binary -f (dry-run) + run: | + dir . + attrib .\coverage\cobertura-coveage.xml + .\out\codecov.exe -f .\coverage\cobertura-coverage.xml -F windows-without-git -d -Z -v -t ${{ secrets.CODECOV_TOKEN }} | tee output_win_without_git.txt + shell: cmd + - name: Run Windows binary auto-detect (dry-run) + run: | + .\out\codecov.exe -F windows-without-git -v -d -Z -t ${{ secrets.CODECOV_TOKEN }} | tee -a output_win_without_git.txt + shell: cmd + - name: Run Windows binary (upload) + run: | + .\out\codecov.exe -F windows-without-git -v -Z -t ${{ secrets.CODECOV_TOKEN }} + shell: cmd + - name: Upload artifacts + uses: actions/upload-artifact@v3 + with: + if-no-files-found: error + path: | + output_win_without_git.txt + + review: + runs-on: ubuntu-latest + needs: + - test-alpine + - test-alpine-proxy + - test-alpine-without-git + - test-linux + - test-linux-without-git + - test-macos + - test-macos-without-git + - test-windows + - test-windows-without-git + steps: + - name: Checkout + uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 18 + cache: 'npm' + - uses: actions/download-artifact@v3 + with: + name: artifact + - name: List files + run: tree + - name: Cat output_alpine.txt + run: cat output_alpine.txt + - name: Cat output_alpine_without_git.txt + run: cat output_alpine_without_git.txt + - name: Cat output_linux.txt + run: cat output_linux.txt + - name: Cat output_linux_without_git.txt + run: cat output_linux_without_git.txt + - name: Cat output_osx.txt + run: cat output_osx.txt + - name: Cat output_osx_without_git.txt + run: cat output_osx_without_git.txt + - name: Cat output_win.txt + run: cat output_win.txt + - name: Cat output_win_without_git.txt + run: cat output_win_without_git.txt diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index c7e62a28d..076f172c5 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -12,7 +12,7 @@ "fast-glob": "3.3.2", "js-yaml": "4.1.0", "snake-case": "3.0.4", - "undici": "6.2.1", + "undici": "5.28.2", "validator": "13.11.0", "yargs": "17.7.2" }, @@ -8388,14 +8388,14 @@ } }, "node_modules/undici": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/undici/-/undici-6.2.1.tgz", - "integrity": "sha512-7Wa9thEM6/LMnnKtxJHlc8SrTlDmxqJecgz1iy8KlsN0/iskQXOQCuPkrZLXbElPaSw5slFFyKIKXyJ3UtbApw==", + "version": "5.28.2", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.2.tgz", + "integrity": "sha512-wh1pHJHnUeQV5Xa8/kyQhO7WFa8M34l026L5P/+2TYiakvGy5Rdc8jWZVyG7ieht/0WgJLEd3kcU5gKx+6GC8w==", "dependencies": { "@fastify/busboy": "^2.0.0" }, "engines": { - "node": ">=18.0" + "node": ">=14.0" } }, "node_modules/undici-types": { @@ -14917,9 +14917,9 @@ "optional": true }, "undici": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/undici/-/undici-6.2.1.tgz", - "integrity": "sha512-7Wa9thEM6/LMnnKtxJHlc8SrTlDmxqJecgz1iy8KlsN0/iskQXOQCuPkrZLXbElPaSw5slFFyKIKXyJ3UtbApw==", + "version": "5.28.2", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.2.tgz", + "integrity": "sha512-wh1pHJHnUeQV5Xa8/kyQhO7WFa8M34l026L5P/+2TYiakvGy5Rdc8jWZVyG7ieht/0WgJLEd3kcU5gKx+6GC8w==", "requires": { "@fastify/busboy": "^2.0.0" } diff --git a/package.json b/package.json index 66691c25f..43e2fb63c 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "fast-glob": "3.3.2", "js-yaml": "4.1.0", "snake-case": "3.0.4", - "undici": "6.2.1", + "undici": "5.28.2", "validator": "13.11.0", "yargs": "17.7.2" },