diff --git a/.github/workflows/asciinema.yml b/.github/workflows/asciinema.yml deleted file mode 100644 index 4eb5355..0000000 --- a/.github/workflows/asciinema.yml +++ /dev/null @@ -1,108 +0,0 @@ ---- -name: build -on: - - push - - pull_request -jobs: - # Code style checks - health: - name: code health check - runs-on: ubuntu-latest - steps: - - name: checkout asciinema - uses: actions/checkout@v4 - - name: setup Python - uses: actions/setup-python@v4 - with: - python-version: "3.10" - - name: install dependencies - run: pip install build cmarkgfm pycodestyle twine - - name: Run pycodestyle - run: > - find . - -name '*\.py' - -exec pycodestyle --ignore=E402,E501,E722,W503 "{}" \+ - - name: Run twine - run: | - python3 -m build - twine check dist/* - # Asciinema checks - asciinema: - name: Asciinema - runs-on: ubuntu-latest - strategy: - matrix: - python: - - "3.7" - - "3.8" - - "3.9" - - "3.10" - - "3.11" - env: - TERM: dumb - steps: - - name: checkout Asciinema - uses: actions/checkout@v4 - - name: setup Python - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python }} - - name: install dependencies - run: pip install pytest - - name: run Asciinema tests - run: script -e -c make test - build_distros: - name: build distro images - strategy: - matrix: - distros: - - alpine - - arch - - debian - - fedora - - ubuntu - runs-on: ubuntu-latest - steps: - - name: Set up Docker buildx - id: buildx - uses: docker/setup-buildx-action@v3 - - name: Authenticate to GHCR - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: "${{ github.actor }}" - password: "${{ secrets.GITHUB_TOKEN }}" - - name: "Build ${{ matrix.distros }} image" - uses: docker/build-push-action@v5 - with: - file: "tests/distros/Dockerfile.${{ matrix.distros }}" - tags: | - "ghcr.io/${{ github.repository }}:${{ matrix.distros }}" - push: true - test_distros: - name: integration test distro images - needs: build_distros - strategy: - matrix: - distros: - - alpine - - arch - - debian - - fedora - - ubuntu - runs-on: ubuntu-latest - container: - image: "ghcr.io/${{ github.repository }}:${{ matrix.distros }}" - credentials: - username: "${{ github.actor }}" - password: "${{ secrets.GITHUB_TOKEN }}" - # https://github.community/t/permission-problems-when-checking-out-code-as-part-of-github-action/202263 - options: "--interactive --tty --user=1001:121" - steps: - - name: checkout Asciinema - uses: actions/checkout@v4 - - name: run integration tests - env: - TERM: dumb - shell: 'script --return --quiet --command "bash {0}"' - run: make test.integration diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..52ef0f3 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,29 @@ +name: CI + +on: + push: + branches: ["develop"] + pull_request: + branches: ["develop"] + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Build + run: cargo build --verbose + + - name: Run tests + run: cargo test --verbose + + - name: Check formatting + run: cargo fmt --check + + - name: Lint with clippy + run: cargo clippy diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml deleted file mode 100644 index 52dfe45..0000000 --- a/.github/workflows/pre-commit.yml +++ /dev/null @@ -1,14 +0,0 @@ ---- -name: pre-commit -on: - - pull_request - - push -jobs: - pre-commit: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - - uses: pre-commit/action@v3.0.0 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml deleted file mode 100644 index 5b93f6e..0000000 --- a/.pre-commit-config.yaml +++ /dev/null @@ -1,39 +0,0 @@ ---- -repos: - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 - hooks: - - id: check-ast - - id: check-json - - id: check-toml - - id: check-yaml - - id: end-of-file-fixer - - id: requirements-txt-fixer - - id: trailing-whitespace - - repo: https://github.com/PyCQA/isort - rev: 5.12.0 - hooks: - - id: isort - - repo: https://github.com/psf/black - rev: 23.1.0 - hooks: - - id: black - - repo: https://github.com/adrienverge/yamllint - rev: v1.29.0 - hooks: - - id: yamllint - - repo: https://github.com/myint/autoflake - rev: v2.0.2 - hooks: - - id: autoflake - args: - - --in-place - - --recursive - - --expand-star-imports - - --remove-all-unused-imports - - --remove-duplicate-keys - - --remove-unused-variables - - repo: https://github.com/pre-commit/mirrors-mypy - rev: "v1.1.1" - hooks: - - id: mypy