diff --git a/.github/workflows/ci-node.yml b/.github/workflows/ci-node.yml new file mode 100644 index 000000000000..33e6f6b8f78f --- /dev/null +++ b/.github/workflows/ci-node.yml @@ -0,0 +1,34 @@ +name: CI - Node +on: + push: + branches: + - main + pull_request: +permissions: + contents: read +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} + cancel-in-progress: true +jobs: + test: + strategy: + matrix: + include: + - name: Static Tests + command: bin/static_tests + - name: Static Lint + command: bin/static_lint + - name: Static Pipeline + command: bin/static_pipeline + name: ${{ matrix.name }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 14.15.5 + cache: 'npm' + - name: Install Node dependencies + run: npm ci + - name: Run ${{ matrix.name }} + run: ${{ matrix.command }} diff --git a/.github/workflows/ci-python.yml b/.github/workflows/ci-python.yml new file mode 100644 index 000000000000..bcf1a2e66106 --- /dev/null +++ b/.github/workflows/ci-python.yml @@ -0,0 +1,73 @@ +name: CI - Python +on: + push: + branches: + - main + pull_request: +permissions: + contents: read +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} + cancel-in-progress: true +jobs: + install: + runs-on: ubuntu-latest + name: Install Python Dependencies + steps: + - uses: actions/checkout@v3 + - name: Install platform dependencies + run: | + sudo apt -y update + sudo apt -y install libcurl4-openssl-dev libssl-dev pkg-config + - uses: actions/setup-python@v4 + with: + python-version-file: '.python-version' + cache: 'pip' + cache-dependency-path: | + requirements.txt + requirements/*.txt + - name: Install Python dependencies + run: | + pip install -U pip setuptools wheel + pip install -r requirements.txt --no-deps + pip install -r requirements/dev.txt + test: + needs: install + strategy: + matrix: + include: + - name: Tests + command: bin/tests --postgresql-host localhost + - name: Lint + command: bin/lint + - name: Documentation + command: bin/docs + - name: Dependencies + command: bin/github-actions-deps + - name: Licenses + command: bin/licenses + - name: Translations + command: bin/translations + runs-on: ubuntu-latest + services: + postgres: + image: postgres:10.1 + ports: + - 5432:5432 + name: ${{ matrix.name }} + steps: + - name: Check out repository + uses: actions/checkout@v3 +# - name: Install platform dependencies +# run: | +# sudo apt -y update +# sudo apt -y install libcurl4-openssl-dev libssl-dev pkg-config + - uses: actions/setup-python@v4 + with: + python-version-file: '.python-version' + cache: 'pip' + cache-dependency-path: | + requirements.txt + requirements/*.txt + - name: Run ${{ matrix.name }} + run: ${{ matrix.command }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index bfb7e5142622..000000000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,110 +0,0 @@ -name: CI -on: - push: - branches: - - main - pull_request: -permissions: - contents: read -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} - cancel-in-progress: true -jobs: - test: - strategy: - matrix: - include: - - name: Tests - command: bin/tests --postgresql-host localhost - needs-python: ${{ true }} - needs-node: ${{ false }} - - name: Lint - command: bin/lint - needs-python: ${{ true }} - needs-node: ${{ false }} - - name: Documentation - command: bin/docs - needs-python: ${{ true }} - needs-node: ${{ false }} - - name: Dependencies - command: bin/github-actions-deps - needs-python: ${{ true }} - needs-node: ${{ false }} - - name: Licenses - command: bin/licenses - needs-python: ${{ true }} - needs-node: ${{ false }} - - name: Translations - command: bin/translations - needs-python: ${{ true }} - needs-node: ${{ false }} - - name: Static Tests - command: bin/static_tests - needs-python: ${{ false }} - needs-node: ${{ true }} - - name: Static Lint - command: bin/static_lint - needs-python: ${{ false }} - needs-node: ${{ true }} - - name: Static Pipeline - command: bin/static_pipeline - needs-python: ${{ false }} - needs-node: ${{ true }} - runs-on: ubuntu-latest - services: - postgres: - image: postgres:10.1 - ports: - - 5432:5432 - name: ${{ matrix.name }} - steps: - - name: Check out repository - uses: actions/checkout@v3 - - name: Install platform dependencies - run: | - sudo apt -y update - sudo apt -y install libcurl4-openssl-dev libssl-dev pkg-config - - uses: actions/setup-python@v4 - if: ${{ matrix.needs-python }} - with: - python-version-file: '.python-version' - - name: Cache Python dependencies - if: ${{ matrix.needs-python }} - uses: actions/cache@v3 - env: - cache-name: warehouse-cache-pip - with: - path: ~/.cache/pip - key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('requirements.txt', 'requirements/*.txt') }} - restore-keys: | - ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}- - ${{ runner.os }}-${{ github.job }}- - ${{ runner.os }}- - - name: Install Python dependencies - if: ${{ matrix.needs-python }} - run: | - pip install -U pip setuptools wheel - pip install -r requirements.txt --no-deps - pip install -r requirements/dev.txt - - uses: actions/setup-node@v3 - if: ${{ matrix.needs-node }} - with: - node-version: 14.15.5 - - name: Cache Node dependencies - if: ${{ matrix.needs-node }} - uses: actions/cache@v2 - env: - cache-name: warehouse-cache-npm - with: - path: ~/.npm - key: ${{ runner.os }}-build-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-build-${{ github.job }}-${{ env.cache-name }}- - ${{ runner.os }}-build-${{ github.job }}- - ${{ runner.os }}-build- - ${{ runner.os }}- - - name: Install Node dependencies - if: ${{ matrix.needs-node }} - run: npm ci - - name: Run ${{ matrix.name }} - run: ${{ matrix.command }}