diff --git a/.github/workflows/hw1.yaml b/.github/workflows/hw1.yaml deleted file mode 100644 index fbfec557f0..0000000000 --- a/.github/workflows/hw1.yaml +++ /dev/null @@ -1,141 +0,0 @@ -name: Homework 1 Check - -on: - pull_request: - branches: - - f24 - workflow_dispatch: - -defaults: - run: - shell: bash - -permissions: - contents: read - -jobs: - hw1: - permissions: - checks: write - contents: read - name: Homework 1 - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest] - node: [16] - runs-on: ${{ matrix.os }} - env: - TEST_ENV: ${{ matrix.test_env || 'production' }} - - services: - mongo: - image: 'mongo:3.7' - ports: - # Maps port 27017 on service container to the host - - 27017:27017 - - steps: - - uses: actions/checkout@v3 - - - run: cp install/package.json package.json - - - name: Install Node - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node }} - - - name: NPM Install - uses: bahmutov/npm-install@v1 - with: - useLockFile: false - - - name: Setup on MongoDB - env: - SETUP: >- - { - "url": "http://127.0.0.1:4567", - "secret": "abcdef", - "admin:username": "admin", - "admin:email": "test@example.org", - "admin:password": "hAN3Eg8W", - "admin:password:confirm": "hAN3Eg8W", - - "database": "mongo", - "mongo:host": "127.0.0.1", - "mongo:port": 27017, - "mongo:username": "", - "mongo:password": "", - "mongo:database": "nodebb" - } - CI: >- - { - "host": "127.0.0.1", - "port": 27017, - "database": "ci_test" - } - run: | - node app --setup="${SETUP}" --ci="${CI}" - - - name: Get specific changed files - id: changed-files-specific - uses: tj-actions/changed-files@v24 - with: - files: | - ./**/*.js - ./**/*.ts - - - name: Check that HW1 specifications are met - run: | - IFS=' ' read -r -a modifiedOrAddedArray <<< "${{ steps.changed-files-specific.outputs.all_changed_and_modified_files }}" - IFS=' ' read -r -a addedarray <<< "${{ steps.changed-files-specific.outputs.added_files }}" - IFS=' ' read -r -a modifiedarray <<< "${{ steps.changed-files-specific.outputs.modified_files }}" - - PASS="false" - - # Checks if any test files were modified or added - for modifiedOrAddedFile in "${modifiedOrAddedArray[@]}" - do - IFS='/ ' read -r -a modifiedOrAddedSplit <<< $modifiedOrAddedFile - FIRSTDIRECTORY="${modifiedOrAddedSplit[0]}" - if [[ "$FIRSTDIRECTORY" == "test" ]] - then - echo "Found test file!" - PASS="true" - break - fi - done - - if [ "$PASS" != "true" ] - then - for addedfile in "${addedarray[@]}" - do - IFS='. ' read -r -a addfilesplit <<< $addedfile - ADDFILENAME="${addfilesplit[0]}" - ADDFILEEXT="${addfilesplit[1]}" - - if [ "$ADDFILEEXT" == "ts" ] - then - for modifiedfile in "${modifiedarray[@]}" - do - IFS='. ' read -r -a modfilesplit <<< $modifiedfile - MODFILENAME="${modfilesplit[0]}" - MODFILEEXT="${modfilesplit[1]}" - - if [ "$MODFILEEXT" == "js" ] && [ "$ADDFILENAME" == "$MODFILENAME" ] - then - echo "Found suitable file!" - PASS="true" - fi - done - fi - done - fi - - if [ "$PASS" != "true" ] - then - echo "No suitable files found that match the requirements of HW1. Please check that you have translated a JS file into TypeScript and regenerated the JavaScript file using % npx tsc or added a test" - echo "Files added (should see your xx.ts file): ${{ steps.changed-files-specific.outputs.added_files }}" - echo "Files modified (should see your xx.js file): ${{ steps.changed-files-specific.outputs.modified_files }}" - exit 1 - fi