From 664c50d63770c41b84d310024913eec31c1f955b Mon Sep 17 00:00:00 2001 From: Miles Johnson Date: Wed, 24 Jan 2024 10:55:28 -0800 Subject: [PATCH] Add github. --- .github/FUNDING.yml | 1 + .github/workflows/ci.yml | 53 +++++++++++++++++++++++++++++++++++ .github/workflows/release.yml | 31 ++++++++++++++++++++ 3 files changed, 85 insertions(+) create mode 100644 .github/FUNDING.yml create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..9139d92 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +github: moonrepo diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..db64511 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,53 @@ +name: CI + +on: + push: + branches: + - master + pull_request: + +jobs: + format: + name: Format + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest] + fail-fast: false + steps: + - uses: actions/checkout@v4 + - uses: moonrepo/setup-rust@v1 + with: + cache: false + components: rustfmt + - run: cargo fmt --all --check + lint: + name: Lint + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest] + fail-fast: false + steps: + - uses: actions/checkout@v4 + - uses: moonrepo/setup-rust@v1 + with: + cache: false + components: clippy + - run: cargo clippy --workspace --all-targets + test: + name: Test + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + fail-fast: false + steps: + - uses: actions/checkout@v4 + - uses: moonrepo/setup-rust@v1 + with: + bins: cargo-nextest + cache: false + - uses: moonrepo/setup-toolchain@v0 + - uses: moonrepo/build-wasm-plugin@v0 + - run: cargo nextest run --no-default-features diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..e2889e0 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,31 @@ +name: Release + +permissions: + contents: write + +on: + push: + tags: + - "[a-z0-9_]+-v[0-9]+*" + pull_request: + +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: moonrepo/setup-rust@v1 + with: + cache: false + - id: build + uses: moonrepo/build-wasm-plugin@v0 + - if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }} + uses: ncipollo/release-action@v1 + with: + artifacts: builds/* + artifactErrorsFailBuild: true + body: ${{ steps.build.outputs.changelog-entry }} + makeLatest: true + prerelease: ${{ contains(github.ref_name, '-alpha') || contains(github.ref_name, '-beta') || contains(github.ref_name, '-rc') }} + skipIfReleaseExists: true