From 624ebd0961639160fb457e700e99716c784e987b Mon Sep 17 00:00:00 2001 From: k-matsuzawa Date: Mon, 10 Jul 2023 09:36:00 +0900 Subject: [PATCH] fix: update github actions (20230710) --- .github/workflows/check_pre-merge.yml | 42 +++++++++---- .github/workflows/code_scanner.yml | 14 ++--- .../workflows/create_release-and-upload.yml | 60 ++++++------------- 3 files changed, 57 insertions(+), 59 deletions(-) diff --git a/.github/workflows/check_pre-merge.yml b/.github/workflows/check_pre-merge.yml index d0cc4fa..5b5325b 100644 --- a/.github/workflows/check_pre-merge.yml +++ b/.github/workflows/check_pre-merge.yml @@ -7,6 +7,7 @@ on: - develop - features/sprint* - stable_v* + - test_ci pull_request: branches: - master @@ -18,14 +19,21 @@ jobs: wasm-test: name: wasm test timeout-minutes: 30 - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 strategy: matrix: - node: [12, 14, 16] + node: [16, 18, 19, 20] + include: + - node: 18 + addopt: 'true' + - node: 19 + addopt: 'true' + - node: 20 + addopt: 'true' steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2.1.2 + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 timeout-minutes: 1 with: node-version: ${{ matrix.node }} @@ -33,11 +41,11 @@ jobs: id: node_ver run: | export node_ver="$(node --version)" - echo "::set-output name=node_version::$node_ver" + echo "node_version=$node_ver" >> $GITHUB_OUTPUT echo "node_version=$node_ver" shell: bash - name: node_modules-useCache - uses: actions/cache@v1 + uses: actions/cache@v3 id: node_cache with: path: node_modules @@ -48,10 +56,10 @@ jobs: id: npm_info run: | npm --version - echo "::set-output name=npm_cachedir::$(npm config get cache)" + echo "npm_cachedir=$(npm config get cache)" >> $GITHUB_OUTPUT - name: use npm cache if: steps.node_cache.outputs.cache-hit != 'true' - uses: actions/cache@v1 + uses: actions/cache@v3 id: npm_cache with: path: ${{ steps.npm_info.outputs.npm_cachedir }} @@ -66,22 +74,36 @@ jobs: npm set progress=false npm ci - name: test + if: matrix.addopt != 'true' run: npm run test + - name: test for nodejs 18 or higher + if: matrix.addopt == 'true' + run: NODE_OPTIONS="--no-experimental-fetch" npm run test - name: example + if: matrix.addopt != 'true' run: | npm run example npm run elements_example + - name: example for nodejs 18 or higher + if: matrix.addopt == 'true' + run: | + NODE_OPTIONS="--no-experimental-fetch" npm run example + NODE_OPTIONS="--no-experimental-fetch" npm run elements_example - name: ts example + if: matrix.addopt != 'true' run: npm run ts_example + - name: ts example for nodejs 18 or higher + if: matrix.addopt == 'true' + run: NODE_OPTIONS="--no-experimental-fetch" npm run ts_example - name: lint_check run: npm run lint_all doxygen-ubuntu: name: doxygen-ubuntu - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: install_doxygen run: sudo apt install doxygen graphviz - name: doxygen_check diff --git a/.github/workflows/code_scanner.yml b/.github/workflows/code_scanner.yml index c32fa1f..1dd6136 100644 --- a/.github/workflows/code_scanner.yml +++ b/.github/workflows/code_scanner.yml @@ -23,7 +23,7 @@ on: jobs: analyze-CodeQL: name: CodeQL - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 strategy: fail-fast: false @@ -36,14 +36,14 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: # We must fetch at least the immediate parents so that if this is a pull request then we can checkout the head. fetch-depth: 2 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v1 + uses: github/codeql-action/init@v2 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -54,16 +54,16 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@v1 + uses: github/codeql-action/autobuild@v2 - # ?? Command-line programs to run using the OS shell. + # Command-line programs to run using the OS shell. # https://git.io/JvXDl - # ? If the Autobuild fails above, remove it and uncomment the following three lines and modify them (or add more) to build your code if your project uses a compiled language + # If the Autobuild fails above, remove it and uncomment the following three lines and modify them (or add more) to build your code if your project uses a compiled language #- run: | # make bootstrap # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 + uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/create_release-and-upload.yml b/.github/workflows/create_release-and-upload.yml index cce406e..8ba1e6f 100644 --- a/.github/workflows/create_release-and-upload.yml +++ b/.github/workflows/create_release-and-upload.yml @@ -8,74 +8,50 @@ on: jobs: create-releases: name: create-releases - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Get the version id: get_version - run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} + run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT - name: check package.json version env: version: ${{ steps.get_version.outputs.VERSION }} run: node ./tools/checker.js version ${version} - name: Create Release id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: softprops/action-gh-release@v1 with: - tag_name: ${{ github.ref }} - release_name: Release ${{ github.ref }} + name: Release ${{ steps.get_version.outputs.VERSION }} body: | Changes in this Release - First Change - Second Change - draft: false prerelease: true continue-on-error: true - - name: Get release - if: steps.create_release.outcome == 'failure' - id: get_release - uses: bruceadams/get-release@v1.2.0 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: output url - id: output_url + - name: Get the asset name + id: asset_name run: | - echo "::set-output name=upload_url::${{steps.get_release.outputs.upload_url}}${{steps.create_release.outputs.upload_url}}" + echo "TAR_NAME=cfdwasm-${{ steps.get_version.outputs.VERSION }}-0.tar" >> $GITHUB_OUTPUT + echo "ZIP_NAME=cfdwasm-${{ steps.get_version.outputs.VERSION }}-0.zip" >> $GITHUB_OUTPUT - name: create archive file - env: - TAR_NAME: cfdwasm-${{ steps.get_version.outputs.VERSION }}-0.tar run: | mkdir work cp -rp dist/* work cp cfdjs_wasm_jsonapi.js work cd work - zip -r ../cfd.zip . - tar -cvf ../$TAR_NAME * + zip -r ../${{ steps.asset_name.outputs.ZIP_NAME }} . + tar -cvf ../${{ steps.asset_name.outputs.TAR_NAME }} * cd .. - gzip $TAR_NAME + gzip ${{ steps.asset_name.outputs.TAR_NAME }} echo "---- dump file ----" ls -l - - name: Upload Release Asset by zip - uses: actions/upload-release-asset@v1.0.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Upload Release Asset + id: upload-release-asset + uses: softprops/action-gh-release@v1 with: - upload_url: ${{ steps.output_url.outputs.upload_url }} - asset_path: ./cfd.zip - asset_name: cfdwasm-${{ steps.get_version.outputs.VERSION }}-0.zip - asset_content_type: application/zip - - name: Upload Release Asset by tgz - uses: actions/upload-release-asset@v1.0.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - TAR_NAME: cfdwasm-${{ steps.get_version.outputs.VERSION }}-0.tar - with: - upload_url: ${{ steps.output_url.outputs.upload_url }} - asset_path: ./${{ env.TAR_NAME }}.gz - asset_name: ${{ env.TAR_NAME }}.gz - asset_content_type: application/gzip - + files: | + ${{ steps.asset_name.outputs.TAR_NAME }}.gz + ${{ steps.asset_name.outputs.ZIP_NAME }}