-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0dcb943
commit f471338
Showing
2 changed files
with
92 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,99 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
workflow_dispatch: | ||
|
||
jobs: | ||
simple-action: | ||
test: | ||
runs-on: arc-runner | ||
|
||
env: | ||
TOX_COMMAND: "tox --skip-missing-interpreters false" | ||
RESOLWE_POSTGRESQL_USER: postgres | ||
RESOLWE_POSTGRESQL_PORT: 55433 | ||
RESOLWE_REDIS_PORT: 56380 | ||
strategy: | ||
matrix: | ||
toxenv: ["py310", "py311"] | ||
|
||
services: | ||
postgres: | ||
image: public.ecr.aws/docker/library/postgres:14 | ||
ports: | ||
- 55433:5432 | ||
env: | ||
POSTGRES_USER: postgres | ||
POSTGRES_HOST_AUTH_METHOD: trust | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
redis: | ||
image: public.ecr.aws/docker/library/redis:7-alpine | ||
ports: | ||
- 56380:6379 | ||
options: >- | ||
--health-cmd "redis-cli ping" | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
steps: | ||
- run: echo "Running." | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
lfs: true | ||
fetch-depth: 0 | ||
|
||
# NOTE: If we are building the "master" branch or a pull request against the | ||
# "master" branch, we allow installing pre-releases with the pip command. | ||
- name: Allow pre-releases for master branch | ||
if: github.ref == 'refs/heads/master' | ||
run: echo "TOX_COMMAND=${{ env.TOX_COMMAND }} --pre" >> $GITHUB_ENV | ||
|
||
- name: Assert PR is up-to-date | ||
if: github.event_name == 'pull_request' | ||
run: | | ||
git_change_target_merge_base=$(git merge-base HEAD origin/${{ github.base_ref }}) | ||
git_change_target_sha=$(git rev-parse origin/${{ github.base_ref }}) | ||
if [[ "${git_change_target_merge_base}" != "${git_change_target_sha}" ]]; then | ||
echo "Pull request is not up-to-date!" | ||
echo "Please, rebase your pull request on top of '${{ github.base_ref }}' (commit: ${git_change_target_sha})." | ||
exit 1 | ||
fi | ||
- name: Documentation | ||
run: | | ||
${{ env.TOX_COMMAND }} -e docs | ||
- name: Linters | ||
run: | | ||
${{ env.TOX_COMMAND }} -e linters | ||
- name: Packaging | ||
run: | | ||
${{ env.TOX_COMMAND }} -e packaging | ||
- name: Extras | ||
run: | | ||
${{ env.TOX_COMMAND }} -e extra | ||
- name: Migrations | ||
run: | | ||
${{ env.TOX_COMMAND }} -e migrations | ||
- name: Unit tests | ||
timeout-minutes: 120 | ||
run: | | ||
${{ env.TOX_COMMAND }} -e ${{ matrix.toxenv }} | ||
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ sftp-config.json | |
|
||
# Ignore dot files | ||
.* | ||
!.github/ | ||
!.env | ||
!.scripts/ | ||
!.placeholder | ||
|