Skip to content

Commit

Permalink
Update github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
williamlsh committed Dec 2, 2022
1 parent 6883863 commit 978959c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 49 deletions.
12 changes: 4 additions & 8 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,27 @@ 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: |
type=semver,pattern={{version}}
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
Expand Down
36 changes: 0 additions & 36 deletions justfile
Original file line number Diff line number Diff line change
@@ -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

Expand Down

0 comments on commit 978959c

Please sign in to comment.