diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5b00174..0a31c9a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,14 +9,14 @@ jobs: runs-on: ubuntu-24.04 steps: - name: Checkout code - uses: actions/checkout@v5 + uses: actions/checkout@v6 with: fetch-depth: 0 # Important for git describe --tags - name: Install Rust uses: actions-rs/toolchain@v1 with: - toolchain: 1.95 + toolchain: 1.96.1 components: cargo - name: Extract Version from Cargo.toml diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 0198b02..3d92124 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -6,6 +6,10 @@ on: pull_request: branches: [ "main" ] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: build: runs-on: ubuntu-24.04 @@ -25,12 +29,12 @@ jobs: --health-retries 5 steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - - name: Install Rust 1.95 + - name: Install Rust uses: actions-rs/toolchain@v1 with: - toolchain: 1.95 + toolchain: 1.96.1 components: clippy, rustfmt override: true @@ -49,11 +53,10 @@ jobs: pg_isready -U ${{ secrets.POSTGRES_USER }} -d ${{ secrets.POSTGRES_DB }} && break sleep 2 done - - # Run database migrations (if you use sqlx migrations) + cargo install sqlx-cli --no-default-features --features native-tls,postgres sqlx migrate run --database-url $DATABASE_URL - + - name: Build run: | mkdir -p ~/.ssh @@ -63,7 +66,7 @@ jobs: eval $(ssh-agent -s) ssh-add -v ~/.ssh/gitea_deploy_key cargo build --verbose --release - + - name: Run tests env: ROOT_DIRECTORY: "/tmp" @@ -71,9 +74,9 @@ jobs: run: | cat .env.sample | head -6 > .env cargo test --verbose -- - + - name: Run clippy run: cargo clippy -- -D warnings - + - name: Run rustfmt run: cargo fmt --all -- --check