diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 2d5e1d9..65edee2 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -13,7 +13,7 @@ jobs: steps: - uses: extractions/setup-just@v1 - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Install Rust toolchain uses: actions-rs/toolchain@v1 with: @@ -22,24 +22,20 @@ jobs: override: true - uses: rui314/setup-mold@v1 - name: Cache build artifacts - uses: Swatinem/rust-cache@v1 + uses: Swatinem/rust-cache@v2 - name: Install cargo-nextest uses: baptiste0928/cargo-install@v1 with: crate: cargo-nextest - - name: Check code style - run: cargo fmt --all -- --check - name: Build code - run: | - just build - readelf -p .comment target/release/pigeon + run: just build - name: Lint code uses: actions-rs/clippy-check@v1 with: token: ${{ secrets.GITHUB_TOKEN }} args: --all-features -- -W clippy::all - name: Test code - run: just test + run: cargo nextest run --all-targets --test-threads=1 # - name: Audit code # uses: actions-rs/audit-check@v1 # with: diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index 75452eb..8e2e438 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -10,10 +10,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Docker meta id: meta - uses: docker/metadata-action@v3 + uses: docker/metadata-action@v4 with: images: ghcr.io/${{ github.repository }} tags: | @@ -21,16 +21,16 @@ jobs: flavor: | latest=true - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v2 - name: Login to GitHub Container Registry if: github.event_name != 'pull_request' - uses: docker/login-action@v1 + uses: docker/login-action@v2 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.CONTAINER_TOKEN }} - name: Build and push image - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v3 with: context: . platforms: linux/amd64 diff --git a/justfile b/justfile index 6f88d80..d0b7acc 100644 --- a/justfile +++ b/justfile @@ -1,42 +1,6 @@ -set dotenv-load - DOCKER_IMAGE := "ghcr.io/williamlsh/pigeon" IMAGE_TAG := "latest" -test: - @cargo nextest run --all-targets --test-threads=1 - -archive: - @RUST_BACKTRACE=1 RUST_LOG=debug cargo run -r -- \ - archive \ - --twitter-api-token $TWITTER_API_TOKEN \ - --twitter-usernames $TWITTER_USERNAMES \ - --rocksdb-path $ROCKSDB_PATH - -export: - @RUST_BACKTRACE=1 RUST_LOG=debug cargo run -r -- \ - export --rocksdb-path $ROCKSDB_PATH - -sync: - @RUST_BACKTRACE=1 RUST_LOG=debug cargo run -r -- \ - sync \ - --telegram-bot-api-token $TELEGRAM_BOT_API_TOKEN \ - --twitter-usernames $TWITTER_USERNAMES \ - --channel-usernames $CHANNEL_USERNAMES \ - --rocksdb-path $ROCKSDB_PATH - -poll: - @RUST_BACKTRACE=1 RUST_LOG=debug cargo run -r -- \ - poll \ - --telegram-bot-api-token $TELEGRAM_BOT_API_TOKEN \ - --twitter-api-token $TWITTER_API_TOKEN \ - --twitter-usernames $TWITTER_USERNAMES \ - --channel-usernames $CHANNEL_USERNAMES \ - --rocksdb-path $ROCKSDB_PATH - -delete-database: - @rm -rf $ROCKSDB_PATH - build: @cargo build -r