diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml new file mode 100644 index 000000000..933386615 --- /dev/null +++ b/.github/workflows/publish-docs.yml @@ -0,0 +1,27 @@ +name: taskchampion + +on: + push: + branches: + - main + +jobs: + mdbook-deploy: + runs-on: ubuntu-latest + needs: mdbook + + steps: + - uses: actions/checkout@v1 + + - name: Setup mdBook + uses: peaceiris/actions-mdbook@v1 + with: + mdbook-version: 'latest' + + - run: mdbook build docs + + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./docs/book diff --git a/.github/workflows/rust-tests.yml b/.github/workflows/rust-tests.yml new file mode 100644 index 000000000..8d9eba149 --- /dev/null +++ b/.github/workflows/rust-tests.yml @@ -0,0 +1,79 @@ +name: taskchampion + +on: + push: + branches: + - main + pull_request: + types: [opened, reopened, synchronize] + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + + - name: Cache cargo registry + uses: actions/cache@v1 + with: + path: ~/.cargo/registry + key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} + + - name: Cache cargo build + uses: actions/cache@v1 + with: + path: target + key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} + + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + + - uses: actions-rs/cargo@v1.0.1 + with: + command: check + + - name: test + run: cargo test + + clippy: + runs-on: ubuntu-latest + needs: test + + steps: + - uses: actions/checkout@v1 + + - name: Cache cargo registry + uses: actions/cache@v1 + with: + path: ~/.cargo/registry + key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} + + - name: Cache cargo build + uses: actions/cache@v1 + with: + path: target + key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} + + - run: rustup component add clippy + + - uses: actions-rs/clippy-check@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + args: --all-features + + mdbook: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + + - name: Setup mdBook + uses: peaceiris/actions-mdbook@v1 + with: + mdbook-version: 'latest' + + - run: mdbook test docs + - run: mdbook build docs diff --git a/.taskcluster.yml b/.taskcluster.yml deleted file mode 100644 index 05b58d6c7..000000000 --- a/.taskcluster.yml +++ /dev/null @@ -1,98 +0,0 @@ -version: 1 -reporting: checks-v1 -policy: - pullRequests: public -tasks: - $if: 'tasks_for in ["github-push", "github-pull-request"]' - then: - $let: - run: - $if: 'tasks_for == "github-push"' - then: {$eval: 'event.ref == "refs/heads/main"'} - else: {$eval: 'event.action in ["opened", "reopened", "synchronize"]'} - repo_url: - $if: 'tasks_for == "github-push"' - then: ${event.repository.clone_url} - else: ${event.pull_request.head.repo.clone_url} - ref: - $if: 'tasks_for == "github-push"' - then: ${event.after} - else: ${event.pull_request.head.sha} - in: - - $if: run - then: - provisionerId: 'proj-misc' - workerType: 'ci' - deadline: {$fromNow: '1 hour'} - expires: {$fromNow: '1 day'} - payload: - maxRunTime: 3600 - image: rust:latest - command: - - /bin/bash - - '-c' - - >- - rustup component add rustfmt && - git clone ${repo_url} repo && - cd repo && - git config advice.detachedHead false && - git checkout ${ref} && - cargo test - metadata: - name: taskchampion-tests - description: Run tests for taskchampion - owner: dustin@v.igoro.us - source: ${repo_url} - - $if: run - then: - provisionerId: 'proj-misc' - workerType: 'ci' - deadline: {$fromNow: '1 hour'} - expires: {$fromNow: '1 day'} - payload: - maxRunTime: 3600 - image: rust:latest - command: - - /bin/bash - - '-c' - - >- - rustup component add rustfmt && - git clone ${repo_url} repo && - cd repo && - git config advice.detachedHead false && - git checkout ${ref} && - rustup component add clippy && - cargo clippy && - cargo fmt -- --check - metadata: - name: taskchampion-clippy - description: Run clippy and rustfmt for taskchampion - owner: dustin@v.igoro.us - source: ${repo_url} - - $if: run - then: - provisionerId: 'proj-misc' - workerType: 'ci' - deadline: {$fromNow: '1 hour'} - expires: {$fromNow: '1 day'} - payload: - maxRunTime: 3600 - image: rust:latest - command: - - /bin/bash - - '-c' - - >- - git clone ${repo_url} repo && - cd repo && - git config advice.detachedHead false && - git checkout ${ref} && - cd docs && - curl -L --compressed https://github.com/rust-lang/mdBook/releases/download/v0.4.4/mdbook-v0.4.4-x86_64-unknown-linux-gnu.tar.gz | gunzip -c | tar -xf - && - chmod +x mdbook && - ./mdbook test && - ./mdbook build - metadata: - name: taskchampion-book - description: Verify that the docs build with mdbook - owner: dustin@v.igoro.us - source: ${repo_url}