diff options
| author | seth <[email protected]> | 2023-04-04 23:23:28 -0400 |
|---|---|---|
| committer | seth <[email protected]> | 2023-04-05 20:34:12 -0400 |
| commit | 65d0b7a553f718b1ba34799e604ceb07c062af61 (patch) | |
| tree | 9a6b1c78aa6e79c2201ba124b536a05231b0ae20 /.github | |
| parent | ed076bbd6fc22b32ea353ae6bd3cac79d039719a (diff) | |
rewrite in rust :)
Diffstat (limited to '.github')
| -rw-r--r-- | .github/workflows/ci.yml | 23 | ||||
| -rw-r--r-- | .github/workflows/format_and_lint.yml | 72 |
2 files changed, 69 insertions, 26 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..ea06d85 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,23 @@ +name: ci + +on: + push: + pull_request: + workflow_dispatch: + +jobs: + build: + strategy: + matrix: + output: [teawiebot, container] + + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - uses: cachix/install-nix-action@v19 + with: + github_access_token: ${{ secrets.GITHUB_TOKEN }} + + - run: | + nix build .#${{ matrix.output }} diff --git a/.github/workflows/format_and_lint.yml b/.github/workflows/format_and_lint.yml index cc2b812..065ae83 100644 --- a/.github/workflows/format_and_lint.yml +++ b/.github/workflows/format_and_lint.yml @@ -1,43 +1,63 @@ -name: Format and Lint +name: format and lint on: push: - branches: - - main, develop pull_request: - branches: - - main, develop + workflow_dispatch: jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + - uses: actions-rs/cargo@v1 + with: + command: check - format_and_lint: + clippy: runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + components: clippy + - uses: actions-rs/clippy-check@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + args: --all-features + fmt: + if: ${{ github.event_name == 'push' }} + runs-on: ubuntu-latest steps: - - name: Checkout HEAD - uses: actions/checkout@v3 + - uses: actions/checkout@v3 + - uses: actions-rs/toolchain@v1 with: - ref: ${{ github.head_ref }} + profile: minimal + toolchain: stable + override: true + components: rustfmt - - name: Run flake8 - uses: microsoft/[email protected] + - uses: actions-rs/cargo@v1 with: - flake8: true - fail_on_error: true + command: fmt + args: --all - - name: Run yapf - uses: mritunjaysharma394/autoyapf@v2 + - uses: cachix/install-nix-action@v19 with: - args: --in-place --recursive . + github_access_token: ${{ secrets.GITHUB_TOKEN }} - - name: Check for Modified Files - id: git-check - run: echo ::set-output name=modified::$(if git diff-index --quiet HEAD --; then echo "false"; else echo "true"; fi) + - run: nix fmt - - name: Push Changes - if: steps.git-check.outputs.modified == 'true' - run: | - git config --global user.name 'github-actions' - git config --global user.email '[email protected]' - git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} - git commit -am "chore: format and lint" + - uses: EndBug/add-and-commit@v9 + with: + default_author: github_actions + message: "chore: fmt files" |
