From 98ea92ab888fbbb0ce3592bdb9ff909193b93ef9 Mon Sep 17 00:00:00 2001 From: bbearcookie Date: Mon, 1 Jan 2024 20:04:05 +0900 Subject: [PATCH] chore: action test --- .github/actions/setup.yml | 11 +++ .github/workflows/build-and-test.yml | 119 -------------------------- .github/workflows/on-pull-request.yml | 92 ++++++++++++++++++++ 3 files changed, 103 insertions(+), 119 deletions(-) create mode 100644 .github/actions/setup.yml delete mode 100644 .github/workflows/build-and-test.yml create mode 100644 .github/workflows/on-pull-request.yml diff --git a/.github/actions/setup.yml b/.github/actions/setup.yml new file mode 100644 index 0000000..7aa0d00 --- /dev/null +++ b/.github/actions/setup.yml @@ -0,0 +1,11 @@ +name: Setup +runs: + - uses: actions/checkout@v3 + + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: 18.x + cache: yarn + + - run: ls -al diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml deleted file mode 100644 index ba4a16b..0000000 --- a/.github/workflows/build-and-test.yml +++ /dev/null @@ -1,119 +0,0 @@ -name: Build/Test on PR - -on: - pull_request: - branches: ['chore/224-express-directory'] - -jobs: - call-hello: - uses: ./.github/workflows/setup.yml - - hello: - runs-on: ubuntu-latest - needs: call-hello - steps: - - uses: actions/checkout@v3 - - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version: 18.x - cache: yarn - - - run: echo ${{ needs.call-hello.outputs.a }} ${{ needs.call-hello.outputs.b }} - - build-react: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version: 18.x - cache: yarn - - - run: yarn - - run: yarn web build - build-express: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version: 18.x - cache: yarn - - - run: yarn - - run: yarn slack build - build-api-docs: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version: 18.x - cache: yarn - - - run: yarn - - run: yarn api-docs build - test-express: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version: 18.x - cache: yarn - - - name: Setting .env - run: | - echo "${{ secrets.EXPRESS_ENV_FILE }}" >> .env - - mv .env packages/slack/.env - cat packages/slack/.env - - # - name: Setting .env - # run: | - # echo "NODE_ENV=${{ secrets.NODE_ENV }}" >> .env - # echo "PORT=${{ secrets.PORT }}" >> .env - # echo "LOCAL_API_ENDPOINT=${{ secrets.LOCAL_API_ENDPOINT }}" >> .env - # echo "DEPLOY_API_ENDPOINT=${{ secrets.DEPLOY_API_ENDPOINT }}" >> .env - - # echo "LOCAL_CLIENT_ENDPOINT=${{ secrets.LOCAL_CLIENT_ENDPOINT }}" >> .env - # echo "DEPLOY_CLIENT_ENDPOINT=${{ secrets.DEPLOY_CLIENT_ENDPOINT }}" >> .env - # echo "DEPLOY_CLIENT_ENDPOINT_LEGACY=${{ secrets.DEPLOY_CLIENT_ENDPOINT_LEGACY }}" >> .env - - # echo "LOCAL_REDIS_ENDPOINT=${{ secrets.LOCAL_REDIS_ENDPOINT }}" >> .env - # echo "DEPLOY_REDIS_ENDPOINT=${{ secrets.DEPLOY_REDIS_ENDPOINT }}" >> .env - # echo "DEPLOY_REDIS_PASSWORD=${{ secrets.DEPLOY_REDIS_PASSWORD }}" >> .env - - # echo "SNS_API_ENDPOINT=${{ secrets.SNS_API_ENDPOINT }}" >> .env - - # echo "SLACK_API_ENDPOINT=${{ secrets.SLACK_API_ENDPOINT }}" >> .env - # echo "SLACK_HOOK_ENDPOINT=${{ secrets.SLACK_HOOK_ENDPOINT }}" >> .env - # echo "SLACK_BOT_TOKEN=${{ secrets.SLACK_BOT_TOKEN }}" >> .env - # echo "SLACK_SIGNING_SECRET=${{ secrets.SLACK_SIGNING_SECRET }}" >> .env - - # echo "DB_DATABASE=${{ secrets.DB_DATABASE }}" >> .env - # echo "LOCAL_DB_USERNAME=${{ secrets.LOCAL_DB_USERNAME }}" >> .env - # echo "LOCAL_DB_PASSWORD=${{ secrets.LOCAL_DB_PASSWORD }}" >> .env - - # echo "DEPLOY_DB_HOST=${{ secrets.DEPLOY_DB_HOST }}" >> .env - # echo "DEPLOY_DB_USERNAME=${{ secrets.DEPLOY_DB_USERNAME }}" >> .env - # echo "DEPLOY_DB_PASSWORD=${{ secrets.DEPLOY_DB_PASSWORD }}" >> .env - - # echo "JWT_SECRET_KEY=${{ secrets.JWT_SECRET_KEY }}" >> .env - # echo "JWT_EXPIRES_IN=${{ secrets.JWT_EXPIRES_IN }}" >> .env - - # mv .env packages/slack/.env - # cat packages/slack/.env - - - run: yarn - - run: yarn slack test diff --git a/.github/workflows/on-pull-request.yml b/.github/workflows/on-pull-request.yml new file mode 100644 index 0000000..a760bcd --- /dev/null +++ b/.github/workflows/on-pull-request.yml @@ -0,0 +1,92 @@ +name: Build/Test on PR + +on: + pull_request: + branches: ['chore/224-express-directory'] + +env: + EXPRESS_ENV_FILE: ${{ secrets.EXPRESS_ENV_FILE }} + +jobs: + call-hello: + uses: ./.github/workflows/setup.yml + + hello: + runs-on: ubuntu-latest + needs: call-hello + steps: + - uses: actions/checkout@v3 + + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: 18.x + cache: yarn + + - run: echo ${{ needs.call-hello.outputs.a }} ${{ needs.call-hello.outputs.b }} + + action-test: + runs-on: ubuntu-latest + steps: + - uses: ./.github/actions/setup.yml + - run: ls -al + + build-react: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: 18.x + cache: yarn + + - run: yarn + - run: yarn web build + build-express: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: 18.x + cache: yarn + + - run: yarn + - run: yarn slack build + build-api-docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: 18.x + cache: yarn + + - run: yarn + - run: yarn api-docs build + test-express: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: 18.x + cache: yarn + + - name: Setting .env + run: | + echo "${{ secrets.EXPRESS_ENV_FILE }}" >> .env + + mv .env packages/slack/.env + cat packages/slack/.env + + - run: yarn + - run: yarn slack test