From 27abf1cffe8aeec0249a09420ebe361209f9d75d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elodie=20Thi=C3=A9blin?= Date: Thu, 17 Aug 2023 15:10:59 +0200 Subject: [PATCH] ci: use github actions instead of gitlab-ci --- .github/workflows/test.yml | 45 ++++++++++++++++++++++++++++++++++++++ .gitlab-ci.yml | 39 --------------------------------- 2 files changed, 45 insertions(+), 39 deletions(-) create mode 100644 .github/workflows/test.yml delete mode 100644 .gitlab-ci.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..57525de --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,45 @@ +name: Test + +on: pull_request + +jobs: + lint: + name: Linting and formatting + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 + name: Install Python + with: + python-version: "3.x" + + - name: Install tox + run: python -m pip install tox + + - name: Run test suite + run: python -m tox -p -e flake8,black,yamllint + + test_tox: + name: Run full tests + needs: lint + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 + name: Install Python + with: + python-version: "3.x" + - name: Install Node + uses: actions/setup-node@v3 + with: + node-version: "latest" + + - name: Install node modules + run: npm ci + + - name: Install tox + run: python -m pip install tox + + - name: Run test suite + run: python -m tox -e py3 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 1a9d4bd..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,39 +0,0 @@ -image: python:latest - -variables: - HTTP_PROXY: $CODE_PROXY - HTTPS_PROXY: $CODE_PROXY - NO_PROXY: $CODE_NO_PROXY - -stages: # List of stages for jobs, and their order of execution - - build - - test - - deploy - -build-job: # This job runs in the build stage, which runs first. - stage: build - script: - - echo "Compiling the code..." - - pip install . - - echo "Compile complete." - -unit-test-job: # This job runs in the test stage. - stage: test # It only starts when the job in the build stage completes successfully. - script: - - echo "Running unit tests... This will take about 60 seconds." - - sleep 60 - - echo "Code coverage is 90%" - -lint-test-job: # This job also runs in the test stage. - stage: test # It can run at the same time as unit-test-job (in parallel). - script: - - echo "Linting code... This will take about 10 seconds." - - sleep 10 - - echo "No lint issues found." - -deploy-job: # This job runs in the deploy stage. - stage: deploy # It only runs when *both* jobs in the test stage complete successfully. - environment: production - script: - - echo "Deploying application..." - - echo "Application successfully deployed."