ci: Improve GitHub Actions config (#430) #2364
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Test | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.ref_name == 'main' && github.sha || 'anysha' }} | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| runs-on: ubuntu-24.04 | |
| services: | |
| postgres: | |
| image: postgres | |
| env: | |
| POSTGRES_USER: test | |
| POSTGRES_PASSWORD: test | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| ports: | |
| - 5432:5432 | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Install asciidoctor | |
| shell: bash | |
| run: | | |
| sudo apt update -y && sudo apt install -y \ | |
| asciidoctor \ | |
| ruby \ | |
| - name: Install asciidoctor-pdf, asciidoctor-mermaid | |
| shell: bash | |
| run: | | |
| sudo gem install rouge | |
| sudo gem install asciidoctor-pdf -v 2.3.2 | |
| sudo gem install asciidoctor-mermaid -v 0.4.1 | |
| sudo npm install -g @mermaid-js/mermaid-cli@11.4.0 | |
| - name: Report versions | |
| run: | | |
| asciidoctor --version | |
| asciidoctor-pdf --version | |
| mmdc --version | |
| - run: | | |
| rustup toolchain install | |
| - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # 2.9.1 | |
| - run: | | |
| cargo test | |
| env: | |
| TEST_DATABASE: postgres://test:test@localhost | |
| RUST_LOG: v=trace,rfd=trace |