Skip to content

Commit

Permalink
Updated Workflow for both gitlab/github
Browse files Browse the repository at this point in the history
  • Loading branch information
SlyPex committed Aug 5, 2024
1 parent 516ec88 commit 07f10ae
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ jobs:

######################
check_readme_file_table:
name: 'Check Table with Number of Challs'
name: 'Check Challs in Readme File'
if: github.head_ref != 'dev'
runs-on: ubuntu-latest
defaults:
Expand Down
27 changes: 9 additions & 18 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@ workflow:
when: always
- if: $CI_PIPELINE_SOURCE == 'push'
when: never

stages:
- Test Challenge Files
- Check Deployability
- Test Deployment
default:
image: ubuntu:22.04

variables:
DIRECTORY: challenges
Expand All @@ -22,41 +19,35 @@ variables:
allow_failure: true
- when: always

Job 1:
Test Challenge Structure:
extends: .standard_rules
stage: Test Challenge Files
image: python:3.11.4-alpine3.18
script:
- python .gitlab/scripts/chall_structure_validator.py $DIRECTORY/$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME

Job 3:
Check Deployability:
extends: .standard_rules
stage: Check Deployability
needs:
- Job 1
image: ubuntu:latest
- Test Challenge Structure
script:
- bash .gitlab/scripts/deployability_checker.sh $DIRECTORY/$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME
- cat deploy.env
artifacts:
reports:
dotenv: deploy.env

Job 4:
Test Challenge Build/Deploy:
extends: .standard_rules
stage: Test Deployment
image: docker:latest
services:
- docker:dind
needs:
- job: Job 3
- job: Check Deployability
artifacts: true
script:
- sh .gitlab/scripts/test_deploy.sh $DIRECTORY/$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME

Job 2:
Check Challs in Readme File:
extends: .standard_rules
stage: Test Challenge Files
image: alpine:3.18
script:
- sh .gitlab/scripts/readme_file_checker.sh $DIRECTORY $README_FILE
- bash .gitlab/scripts/readme_file_checker.sh $DIRECTORY $README_FILE

0 comments on commit 07f10ae

Please sign in to comment.