From cbd02f8a148caf7a7a687f1de3906ba068b5ba2f Mon Sep 17 00:00:00 2001 From: Noritada Kobayashi Date: Wed, 4 Sep 2024 00:41:31 +0900 Subject: [PATCH 1/2] CI/CD: add a workflow to check formats of GitHub config files --- .github/workflows/ci.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b2d975a..d7ee640 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -117,3 +117,14 @@ jobs: RUSTFLAGS: -Z sanitizer=address RUSTDOCFLAGS: -Z sanitizer=address run: cargo test --target x86_64-unknown-linux-gnu --workspace --features gridpoints-proj + + check_github_config_formats: + name: Check GitHub config formats + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install Prettier + run: npm install -g prettier + - name: Run prettier + run: prettier .github --check From 3e8da9a5bae60645fadc461dfc660ec546308e2b Mon Sep 17 00:00:00 2001 From: Noritada Kobayashi Date: Wed, 4 Sep 2024 00:47:04 +0900 Subject: [PATCH 2/2] Reformat YAML files for GitHub config using Prettier --- .github/ISSUE_TEMPLATE/bug-report.yml | 68 +++++++-------- .../ISSUE_TEMPLATE/data-support-request.yml | 24 +++--- .github/workflows/cd.yml | 82 +++++++++---------- .github/workflows/ci.yml | 72 ++++++++-------- .github/workflows/pages.yml | 2 +- 5 files changed, 124 insertions(+), 124 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index b2bb76f..ca419a6 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -2,38 +2,38 @@ name: "Bug report \U0001F41B" description: Create a bug report to help us improve labels: [bug] body: -- type: textarea - attributes: - label: Simple Description on the Bug - description: A clear and concise description on what is the problem for you. - validations: - required: true -- type: textarea - attributes: - label: Steps to Reproduce - placeholder: | - Examples of steps in case you use the library: - 1. Pass ... to ... - 2. See error ... + - type: textarea + attributes: + label: Simple Description on the Bug + description: A clear and concise description on what is the problem for you. + validations: + required: true + - type: textarea + attributes: + label: Steps to Reproduce + placeholder: | + Examples of steps in case you use the library: + 1. Pass ... to ... + 2. See error ... - Examples of steps in case you use the CLI: - 1. Run ... with command line arguments ... on OS ... - 2. See error ... - validations: - required: true -- type: textarea - attributes: - label: Expected Behavior - description: A clear and concise description of what you expected to happen. - validations: - required: true -- type: textarea - attributes: - label: Actual Behavior - description: A clear and concise description of what you actually saw. - validations: - required: true -- type: textarea - attributes: - label: Additional Context - description: Any other context about the problem. + Examples of steps in case you use the CLI: + 1. Run ... with command line arguments ... on OS ... + 2. See error ... + validations: + required: true + - type: textarea + attributes: + label: Expected Behavior + description: A clear and concise description of what you expected to happen. + validations: + required: true + - type: textarea + attributes: + label: Actual Behavior + description: A clear and concise description of what you actually saw. + validations: + required: true + - type: textarea + attributes: + label: Additional Context + description: Any other context about the problem. diff --git a/.github/ISSUE_TEMPLATE/data-support-request.yml b/.github/ISSUE_TEMPLATE/data-support-request.yml index c0ea2a3..cfd2afc 100644 --- a/.github/ISSUE_TEMPLATE/data-support-request.yml +++ b/.github/ISSUE_TEMPLATE/data-support-request.yml @@ -2,15 +2,15 @@ name: "Data support request \U0001F4E1" description: Suggest a support of specific data labels: [data-support] body: -- type: textarea - attributes: - label: Detailed Information on the Data - placeholder: | - - A URL of available sample data, which can be included in this project without concerns about license and size if possible. - - A URL of specification or other resources concerning that format, if any. - validations: - required: true -- type: textarea - attributes: - label: Additional Context - description: Any other context about the data support request. + - type: textarea + attributes: + label: Detailed Information on the Data + placeholder: | + - A URL of available sample data, which can be included in this project without concerns about license and size if possible. + - A URL of specification or other resources concerning that format, if any. + validations: + required: true + - type: textarea + attributes: + label: Additional Context + description: Any other context about the data support request. diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 7b45ce1..f0a0b93 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -2,7 +2,7 @@ name: CD on: push: - branches: [ master, 'release/v[0-9].[0-9]' ] + branches: [master, "release/v[0-9].[0-9]"] workflow_dispatch: @@ -23,43 +23,43 @@ jobs: runs-on: ${{ matrix.os }} steps: - - name: Checkout - uses: actions/checkout@v4 - with: - submodules: recursive - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - targets: ${{ matrix.target }} - # - name: Set up musl - # if: matrix.target == 'x86_64-unknown-linux-musl' - # run: | - # rustup target add x86_64-unknown-linux-musl - # sudo apt -qq install musl-tools - # - name: Set up C++ build tools for building PROJ - # if: matrix.target == 'x86_64-unknown-linux-musl' - # run: | - # sudo apt -qq install build-essential g++-multilib - # sudo ln -s /usr/bin/g++ /usr/bin/musl-g++ - - name: Build - run: cargo build --release --target ${{ matrix.target }} --verbose --workspace - - name: Create an archive to maintain the file permission (in non-Windows environments) - if: matrix.target != 'x86_64-pc-windows-msvc' - run: | - tar -C target/${{ matrix.target }}/release -cvf gribber-${{ matrix.target }}.tar.xz gribber - - name: Create an archive to maintain the file permission (in Windows environments) - if: matrix.target == 'x86_64-pc-windows-msvc' - run: | - powershell Compress-Archive -Path target/${{ matrix.target }}/release/gribber.exe -DestinationPath gribber-${{ matrix.target }}.zip - - name: Upload artifacts (in non-Windows environments) - if: matrix.target != 'x86_64-pc-windows-msvc' - uses: actions/upload-artifact@v4 - with: - name: gribber-${{ matrix.target }} - path: gribber-${{ matrix.target }}.tar.xz - - name: Upload artifacts (in Windows environments) - if: matrix.target == 'x86_64-pc-windows-msvc' - uses: actions/upload-artifact@v4 - with: - name: gribber-${{ matrix.target }} - path: gribber-${{ matrix.target }}.zip + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + targets: ${{ matrix.target }} + # - name: Set up musl + # if: matrix.target == 'x86_64-unknown-linux-musl' + # run: | + # rustup target add x86_64-unknown-linux-musl + # sudo apt -qq install musl-tools + # - name: Set up C++ build tools for building PROJ + # if: matrix.target == 'x86_64-unknown-linux-musl' + # run: | + # sudo apt -qq install build-essential g++-multilib + # sudo ln -s /usr/bin/g++ /usr/bin/musl-g++ + - name: Build + run: cargo build --release --target ${{ matrix.target }} --verbose --workspace + - name: Create an archive to maintain the file permission (in non-Windows environments) + if: matrix.target != 'x86_64-pc-windows-msvc' + run: | + tar -C target/${{ matrix.target }}/release -cvf gribber-${{ matrix.target }}.tar.xz gribber + - name: Create an archive to maintain the file permission (in Windows environments) + if: matrix.target == 'x86_64-pc-windows-msvc' + run: | + powershell Compress-Archive -Path target/${{ matrix.target }}/release/gribber.exe -DestinationPath gribber-${{ matrix.target }}.zip + - name: Upload artifacts (in non-Windows environments) + if: matrix.target != 'x86_64-pc-windows-msvc' + uses: actions/upload-artifact@v4 + with: + name: gribber-${{ matrix.target }} + path: gribber-${{ matrix.target }}.tar.xz + - name: Upload artifacts (in Windows environments) + if: matrix.target == 'x86_64-pc-windows-msvc' + uses: actions/upload-artifact@v4 + with: + name: gribber-${{ matrix.target }} + path: gribber-${{ matrix.target }}.zip diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d7ee640..0c37fc8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,11 +2,11 @@ name: CI on: push: - branches: [ master, testing, 'release/v[0-9].[0-9]' ] + branches: [master, testing, "release/v[0-9].[0-9]"] pull_request: - branches: [ master ] + branches: [master] schedule: - - cron: '0 21 * * *' + - cron: "0 21 * * *" workflow_dispatch: @@ -62,45 +62,45 @@ jobs: runs-on: ${{ matrix.os }} steps: - - name: Checkout - uses: actions/checkout@v4 - with: - submodules: recursive - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - targets: ${{ matrix.target }} - # - name: Set up musl - # if: matrix.target == 'x86_64-unknown-linux-musl' - # run: | - # rustup target add x86_64-unknown-linux-musl - # sudo apt -qq install musl-tools - # - name: Set up C++ build tools for building PROJ - # if: matrix.target == 'x86_64-unknown-linux-musl' - # run: | - # sudo apt -qq install build-essential g++-multilib - # sudo ln -s /usr/bin/g++ /usr/bin/musl-g++ - - name: Build - run: cargo build --target ${{ matrix.target }} --verbose --workspace ${{ matrix.features }} - - name: Run tests - if: matrix.with_test - run: cargo test --target ${{ matrix.target }} --verbose --workspace ${{ matrix.features }} + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + targets: ${{ matrix.target }} + # - name: Set up musl + # if: matrix.target == 'x86_64-unknown-linux-musl' + # run: | + # rustup target add x86_64-unknown-linux-musl + # sudo apt -qq install musl-tools + # - name: Set up C++ build tools for building PROJ + # if: matrix.target == 'x86_64-unknown-linux-musl' + # run: | + # sudo apt -qq install build-essential g++-multilib + # sudo ln -s /usr/bin/g++ /usr/bin/musl-g++ + - name: Build + run: cargo build --target ${{ matrix.target }} --verbose --workspace ${{ matrix.features }} + - name: Run tests + if: matrix.with_test + run: cargo test --target ${{ matrix.target }} --verbose --workspace ${{ matrix.features }} build_wasm: name: Building library for wasm runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v4 - with: - submodules: recursive - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - targets: wasm32-unknown-unknown - - name: Build - run: cargo build --target wasm32-unknown-unknown --verbose + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + targets: wasm32-unknown-unknown + - name: Build + run: cargo build --target wasm32-unknown-unknown --verbose address_sanitizer: name: Address sanitizer diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index bbcc3d1..76bfdfe 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -1,7 +1,7 @@ name: Deploy the latest documentation and WASM app to GitHub Pages on: push: - branches: [ master ] + branches: [master] workflow_dispatch: