Skip to content

Commit

Permalink
Fix ci.yml to use devcontainers/[email protected]
Browse files Browse the repository at this point in the history
  • Loading branch information
yiwiy9 committed Sep 16, 2023
1 parent be0d542 commit 4429b10
Showing 1 changed file with 28 additions and 17 deletions.
45 changes: 28 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,39 @@
name: CI

name: 'build'
on:
# pull_request:
push:
branches: [ main ]
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup .env file
run: |
cp .devcontainer/.env.example .devcontainer/.env
sed -i "s/your_atcoder_username_here/${{ secrets.ATCODER_USERNAME }}/g" .devcontainer/.env
sed -i "s/your_atcoder_password_here/${{ secrets.ATCODER_PASSWORD }}/g" .devcontainer/.env
- name: Checkout (GitHub)
uses: actions/checkout@v4

- name: Build Devcontainer Docker Image
run: docker build .devcontainer -t atcoder-rust-devcontainer:test
- name: Setup .env file
run: |
cp .devcontainer/.env.example .devcontainer/.env
sed -i "s/your_atcoder_username_here/${{ secrets.ATCODER_USERNAME }}/g" .devcontainer/.env
sed -i "s/your_atcoder_password_here/${{ secrets.ATCODER_PASSWORD }}/g" .devcontainer/.env
- name: Execute initialization scripts
run: docker run --rm atcoder-rust-devcontainer:test
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Test cargo_compete_new.sh
run: docker run --rm atcoder-rust-devcontainer:test cargo_compete_new.sh abc317
- name: Build and run Dev Container task
uses: devcontainers/[email protected]
with:
imageName: ghcr.io/yiwiy9/atcoder-rust-devcontainer
runCmd: |
cargo_compete_new.sh abc317
cd $WORKSPACE_FOLDER/src/contest/abc317/
cargo compete test a
cd $WORKSPACE_FOLDER/src/contest/problems/
cargo compete add abc317_a
cargo compete test abc317_a

0 comments on commit 4429b10

Please sign in to comment.