Skip to content

Commit

Permalink
fix: update github actions (20230710)
Browse files Browse the repository at this point in the history
  • Loading branch information
k-matsuzawa committed Jul 10, 2023
1 parent 715e088 commit 624ebd0
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 59 deletions.
42 changes: 32 additions & 10 deletions .github/workflows/check_pre-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
- develop
- features/sprint*
- stable_v*
- test_ci
pull_request:
branches:
- master
Expand All @@ -18,26 +19,33 @@ 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 }}
- name: dump node version
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
Expand All @@ -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 }}
Expand All @@ -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
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/code_scanner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ on:
jobs:
analyze-CodeQL:
name: CodeQL
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04

strategy:
fail-fast: false
Expand All @@ -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.
Expand All @@ -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
60 changes: 18 additions & 42 deletions .github/workflows/create_release-and-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
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/[email protected]
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/[email protected]
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 }}

0 comments on commit 624ebd0

Please sign in to comment.